-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
httpcaddyfile: Allow
hostnames
& logger name overrides for log dire…
…ctive (#5643) * httpcaddyfile: Allow `hostnames` override for log directive * Implement access logger name overrides * Fix panic & default logger clobbering edgecase
- Loading branch information
1 parent
da23501
commit 5c51c1d
Showing
6 changed files
with
342 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
caddytest/integration/caddyfile_adapt/log_override_hostname.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
*.example.com { | ||
log { | ||
hostnames foo.example.com bar.example.com | ||
output file /foo-bar.txt | ||
} | ||
log { | ||
hostnames baz.example.com | ||
output file /baz.txt | ||
} | ||
} | ||
---------- | ||
{ | ||
"logging": { | ||
"logs": { | ||
"default": { | ||
"exclude": [ | ||
"http.log.access.log0", | ||
"http.log.access.log1" | ||
] | ||
}, | ||
"log0": { | ||
"writer": { | ||
"filename": "/foo-bar.txt", | ||
"output": "file" | ||
}, | ||
"include": [ | ||
"http.log.access.log0" | ||
] | ||
}, | ||
"log1": { | ||
"writer": { | ||
"filename": "/baz.txt", | ||
"output": "file" | ||
}, | ||
"include": [ | ||
"http.log.access.log1" | ||
] | ||
} | ||
} | ||
}, | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":443" | ||
], | ||
"routes": [ | ||
{ | ||
"match": [ | ||
{ | ||
"host": [ | ||
"*.example.com" | ||
] | ||
} | ||
], | ||
"terminal": true | ||
} | ||
], | ||
"logs": { | ||
"logger_names": { | ||
"bar.example.com": "log0", | ||
"baz.example.com": "log1", | ||
"foo.example.com": "log0" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.