diff --git a/backend/log/writer.go b/backend/log/writer.go index 8e922a491..dd419f4ee 100644 --- a/backend/log/writer.go +++ b/backend/log/writer.go @@ -99,7 +99,7 @@ func NewWriterFromConfig(c *Config) (RollingWriter, error) { stdErrFileHandler = file if runtime.GOOS != "windows" { - if err = syscall.Dup2(int(file.Fd()), int(os.Stderr.Fd())); err != nil { + if err = syscall.Dup3(int(file.Fd()), int(os.Stderr.Fd()), 0); err != nil { return nil, err } runtime.SetFinalizer(stdErrFileHandler, func(fd *os.File) {