mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
core: Return default logger if no modules loaded
Fix report from: https://caddy.community/t/remote-caddyfile-invalid-memory-address-or-nil-pointer-dereference/19700/3
This commit is contained in:
parent
b301a3df70
commit
c6ac350a3b
1 changed files with 3 additions and 0 deletions
|
@ -480,6 +480,9 @@ func (ctx Context) Logger(module ...Module) *zap.Logger {
|
||||||
if len(module) > 0 {
|
if len(module) > 0 {
|
||||||
mod = module[0]
|
mod = module[0]
|
||||||
}
|
}
|
||||||
|
if mod == nil {
|
||||||
|
return Log()
|
||||||
|
}
|
||||||
return ctx.cfg.Logging.Logger(mod)
|
return ctx.cfg.Logging.Logger(mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue