summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/server.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go
index 4d47d26..60fc3c3 100644
--- a/modules/caddyhttp/server.go
+++ b/modules/caddyhttp/server.go
@@ -639,21 +639,18 @@ func (s *Server) shouldLogRequest(r *http.Request) bool {
// logging is disabled
return false
}
+ if _, ok := s.Logs.LoggerNames[r.Host]; ok {
+ // this host is mapped to a particular logger name
+ return true
+ }
for _, dh := range s.Logs.SkipHosts {
// logging for this particular host is disabled
if certmagic.MatchWildcard(r.Host, dh) {
return false
}
}
- if _, ok := s.Logs.LoggerNames[r.Host]; ok {
- // this host is mapped to a particular logger name
- return true
- }
- if s.Logs.SkipUnmappedHosts {
- // this host is not mapped and thus must not be logged
- return false
- }
- return true
+ // if configured, this host is not mapped and thus must not be logged
+ return !s.Logs.SkipUnmappedHosts
}
// protocol returns true if the protocol proto is configured/enabled.