mirror of
https://github.com/caddyserver/caddy.git
synced 2025-11-02 06:36:29 +08:00
log: default logger should respect {in,ex}clude (#6995)
* log: default logger should respect `{in,ex}clude`
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
* add tests
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
---------
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
committed by
GitHub
parent
320c57291d
commit
9f7148392a
@ -162,7 +162,9 @@ func (logging *Logging) setupNewDefault(ctx Context) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("setting up default log: %v", err)
|
||||
}
|
||||
newDefault.logger = zap.New(newDefault.CustomLog.core, options...)
|
||||
|
||||
filteringCore := &filteringCore{newDefault.CustomLog.core, newDefault.CustomLog}
|
||||
newDefault.logger = zap.New(filteringCore, options...)
|
||||
|
||||
// redirect the default caddy logs
|
||||
defaultLoggerMu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user