Skip to content

Commit c56db5a

Browse files
authored
Ensure logger writes to log_file by preventing overwrite of InterceptLogger's output (#29917)
* Ensure logger writes to log_file by preventing overwrite of InterceptLogger's output * add changelog
1 parent c4dc26b commit c56db5a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

changelog/29917.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
core: Fix a bug that prevents certain loggers from writing to a log file.
3+
```

command/server.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,7 @@ func (c *ServerCommand) AutocompleteFlags() complete.Flags {
420420
}
421421

422422
func (c *ServerCommand) flushLog() {
423-
c.logger.(hclog.OutputResettable).ResetOutputWithFlush(&hclog.LoggerOptions{
424-
Output: c.logWriter,
425-
}, c.logGate)
423+
c.logGate.Flush()
426424
}
427425

428426
func (c *ServerCommand) parseConfig() (*server.Config, []configutil.ConfigError, error) {

0 commit comments

Comments
 (0)