From e59379e2c39447d31a688387f9ad63835c180bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Sch=C3=B6n?= Date: Wed, 13 Jan 2021 14:53:52 +0100 Subject: [PATCH 1/2] don't prefix json logging (fixes #9489) --- command/agent/command.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 93ddaf5e7d27..2e56f9f8afd2 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -618,6 +618,15 @@ func (c *Command) Run(args []string) int { return 1 } + // GH-9489: 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 From dbd0f62b23cc9a9599de21b796f798077a6d5f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Sch=C3=B6n?= Date: Wed, 20 Jan 2021 14:34:06 +0100 Subject: [PATCH 2/2] remove github issue from comment Co-authored-by: Tim Gross --- command/agent/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/agent/command.go b/command/agent/command.go index 2e56f9f8afd2..cf875d5226b8 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -618,7 +618,7 @@ func (c *Command) Run(args []string) int { return 1 } - // GH-9489: Reset UI to prevent prefixed json output + // reset UI to prevent prefixed json output if config.LogJson { c.Ui = &cli.BasicUi{ Reader: os.Stdin,