From c56db5a575fd3157ef8ce50678c29f263cffd390 Mon Sep 17 00:00:00 2001 From: Ellie Date: Thu, 13 Mar 2025 13:43:40 -0500 Subject: [PATCH] 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 --- changelog/29917.txt | 3 +++ command/server.go | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/29917.txt diff --git a/changelog/29917.txt b/changelog/29917.txt new file mode 100644 index 0000000000..fd51133280 --- /dev/null +++ b/changelog/29917.txt @@ -0,0 +1,3 @@ +```release-note:bug +core: Fix a bug that prevents certain loggers from writing to a log file. +``` diff --git a/command/server.go b/command/server.go index 20abe21554..581306afb3 100644 --- a/command/server.go +++ b/command/server.go @@ -420,9 +420,7 @@ func (c *ServerCommand) AutocompleteFlags() complete.Flags { } func (c *ServerCommand) flushLog() { - c.logger.(hclog.OutputResettable).ResetOutputWithFlush(&hclog.LoggerOptions{ - Output: c.logWriter, - }, c.logGate) + c.logGate.Flush() } func (c *ServerCommand) parseConfig() (*server.Config, []configutil.ConfigError, error) {