From 304d0cf5958065d14ab8b704055b1bb11d915876 Mon Sep 17 00:00:00 2001 From: Will Jordan Date: Thu, 19 May 2022 12:40:30 -0700 Subject: [PATCH] Don't buffer json logs on agent startup (#13076) There's no reason to buffer json logs on agent startup since logs in this format already aren't reordered. --- .changelog/13076.txt | 3 +++ command/agent/command.go | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .changelog/13076.txt diff --git a/.changelog/13076.txt b/.changelog/13076.txt new file mode 100644 index 000000000000..b388b8199bab --- /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 +``` diff --git a/command/agent/command.go b/command/agent/command.go index 42aa4a553a40..9ca58ce2c69f 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