From afa0018587e23a5ef6880d0eea8a45e74d33b41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Sch=C3=B6n?= Date: Wed, 20 Jan 2021 15:09:31 +0100 Subject: [PATCH] don't prefix json logging --- command/agent/command.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 93ddaf5e7..cf875d522 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -618,6 +618,15 @@ func (c *Command) Run(args []string) int { return 1 } + // reset UI to prevent prefixed json output + if config.LogJson { + c.Ui = &cli.BasicUi{ + Reader: os.Stdin, + Writer: os.Stdout, + ErrorWriter: os.Stderr, + } + } + // Setup the log outputs logFilter, logGate, logOutput := SetupLoggers(c.Ui, config) c.logFilter = logFilter