From 075916aea88ef5c350a86ab80dda3eee3023cac4 Mon Sep 17 00:00:00 2001 From: Will Jordan Date: Thu, 19 May 2022 11:46:10 -0700 Subject: [PATCH 1/2] Don't buffer json logs on agent startup There's no reason to buffer json logs on agent startup since logs in this format already aren't reordered. --- command/agent/command.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 42aa4a553a4..9ca58ce2c69 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -703,6 +703,8 @@ func (c *Command) Run(args []string) int { // Swap out UI implementation if json logging is enabled if config.LogJson { c.Ui = &logging.HcLogUI{Log: logger} + // Don't buffer json logs because they aren't reordered anyway. + logGate.Flush() } // Log config files From 9f30a3dd023e1f00e34654d1150ec4bf39ee17cd Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 19 May 2022 15:27:02 -0400 Subject: [PATCH 2/2] changelog entry --- .changelog/13076.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/13076.txt diff --git a/.changelog/13076.txt b/.changelog/13076.txt new file mode 100644 index 00000000000..b388b8199ba --- /dev/null +++ b/.changelog/13076.txt @@ -0,0 +1,3 @@ +```release-note:improvement +agent: logs are no longer buffered at startup when logging in JSON format +```