mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-12 21:43:56 +08:00
5c51c1db2c
* httpcaddyfile: Allow `hostnames` override for log directive * Implement access logger name overrides * Fix panic & default logger clobbering edgecase
71 lines
1.0 KiB
Plaintext
71 lines
1.0 KiB
Plaintext
*.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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |