mirror of
https://github.com/kataras/iris.git
synced 2025-03-21 15:56:26 +01:00
fix the issue of accesslog closing the default writer os.Stdout by SetOutput() method
This commit is contained in:
parent
af2d017e1b
commit
d058d999b8
|
@ -498,6 +498,10 @@ func (ac *AccessLog) setOutput(reset bool, writers ...io.Writer) {
|
||||||
}
|
}
|
||||||
for _, closer := range closers {
|
for _, closer := range closers {
|
||||||
if closer != nil {
|
if closer != nil {
|
||||||
|
// cannot close os.Stdout/os.Stderr
|
||||||
|
if closer == os.Stdout || closer == os.Stderr {
|
||||||
|
continue
|
||||||
|
}
|
||||||
closer.Close()
|
closer.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user