Skip to content

Commit

Permalink
Don't buffer json logs on agent startup (#13076)
Browse files Browse the repository at this point in the history
There's no reason to buffer json logs on agent startup
since logs in this format already aren't reordered.
  • Loading branch information
wjordan committed May 19, 2022
1 parent a143da9 commit 304d0cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/13076.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
agent: logs are no longer buffered at startup when logging in JSON format
```
2 changes: 2 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 304d0cf

Please sign in to comment.