Ok, FWIW, here’s what i got to work with minimal repro:
WORKS (BTW, this is the output of caddy adapt
with logging at the top)
{
"logging": {
"logs": {
"default": {
"exclude": [
"http.log.access.filelog"
]
},
"filelog": {
"writer": {
"filename": "access-foo.json",
"output": "file"
},
"include": [
"http.log.access.filelog"
]
}
}
},
"apps": {
"http": {
"servers": {
"spartacus_server": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"body": "Hello",
"handler": "static_response"
}
]
},
{
"match": [
{
"host": [
"localhost"
]
}
]
}
],
"logs": {
"logger_names": {
"localhost": "filelog" // HERE----------------
}
}
}
}
}
}
}
Prints to STDOUT:
{
"logging": {
"logs": {
"default": {
"exclude": [
"http.log.access.filelog"
]
},
"filelog": {
"writer": {
"filename": "access-foo.json",
"output": "file"
},
"include": [
"http.log.access.filelog"
]
}
}
},
"apps": {
"http": {
"servers": {
"spartacus_server": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"body": "Hello",
"handler": "static_response"
}
]
},
{
"match": [
{
"host": [
"localhost"
]
}
]
}
],
"logs": {
"logger_names": {
"spartacus_server": "filelog" // HERE----------------
}
}
}
}
}
}
}
This seems super non-intuitive - unless i misread, the log is associated with the domain name, not the server name?