summaryrefslogtreecommitdiff
path: root/logging.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-10-05 14:14:13 -0400
committerGitHub <noreply@github.com>2022-10-05 12:14:13 -0600
commit99ffe9338837eff80def7e5d51c2a0e02f56abdb (patch)
treef9168596a126540e9ab1a38ae79fb7359877e1d5 /logging.go
parente07a267276b9c00181c979ec65f26e25b8325beb (diff)
logging: Fix `skip_hosts` with wildcards (#5102)
Fix #4859
Diffstat (limited to 'logging.go')
-rw-r--r--logging.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/logging.go b/logging.go
index 5f8ea06..c00c831 100644
--- a/logging.go
+++ b/logging.go
@@ -105,7 +105,7 @@ func (logging *Logging) openLogs(ctx Context) error {
// then set up any other custom logs
for name, l := range logging.Logs {
// the default log is already set up
- if name == "default" {
+ if name == DefaultLoggerName {
continue
}
@@ -138,7 +138,7 @@ func (logging *Logging) setupNewDefault(ctx Context) error {
// extract the user-defined default log, if any
newDefault := new(defaultCustomLog)
- if userDefault, ok := logging.Logs["default"]; ok {
+ if userDefault, ok := logging.Logs[DefaultLoggerName]; ok {
newDefault.CustomLog = userDefault
} else {
// if none, make one with our own default settings
@@ -147,7 +147,7 @@ func (logging *Logging) setupNewDefault(ctx Context) error {
if err != nil {
return fmt.Errorf("setting up default Caddy log: %v", err)
}
- logging.Logs["default"] = newDefault.CustomLog
+ logging.Logs[DefaultLoggerName] = newDefault.CustomLog
}
// set up this new log
@@ -702,6 +702,8 @@ var (
var writers = NewUsagePool()
+const DefaultLoggerName = "default"
+
// Interface guards
var (
_ io.WriteCloser = (*notClosable)(nil)