Merge pull request #1863 from lrita/master

fix the issue of accesslog closing the default writer os.Stdout by SetOutput() method
This commit is contained in:
Gerasimos (Makis) Maropoulos 2022-03-18 22:14:50 +02:00 committed by GitHub
commit 0381d6f2b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -498,6 +498,10 @@ func (ac *AccessLog) setOutput(reset bool, writers ...io.Writer) {
}
for _, closer := range closers {
if closer != nil {
// cannot close os.Stdout/os.Stderr
if closer == os.Stdout || closer == os.Stderr {
continue
}
closer.Close()
}
}