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 +``` 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