From d515e5c3b0687a7c8c93976621e801b8aede0e5d 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 000000000..b388b8199 --- /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 42aa4a553..9ca58ce2c 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