mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
fix the issue of accesslog closing the default writer os.Stdout by SetOutput() method
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user