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.
This commit is contained in:
Will Jordan 2022-05-19 12:40:30 -07:00 committed by GitHub
parent d9c10fccde
commit d515e5c3b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

3
.changelog/13076.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
agent: logs are no longer buffered at startup when logging in JSON format
```

View File

@ -703,6 +703,8 @@ func (c *Command) Run(args []string) int {
// Swap out UI implementation if json logging is enabled // Swap out UI implementation if json logging is enabled
if config.LogJson { if config.LogJson {
c.Ui = &logging.HcLogUI{Log: logger} c.Ui = &logging.HcLogUI{Log: logger}
// Don't buffer json logs because they aren't reordered anyway.
logGate.Flush()
} }
// Log config files // Log config files