Skip to content

Commit

Permalink
Rewrite adapter test to be more representative of the usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Apr 16, 2024
1 parent 0df599a commit 29c55ab
Showing 1 changed file with 60 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,42 +1,81 @@
{
log json {
output file /var/log/caddy-json.log
(log-both) {
log {args[0]}-json {
hostnames {args[0]}
output file /var/log/{args[0]}.log
format json
}
log console {
output stdout
log {args[0]}-console {
hostnames {args[0]}
output file /var/log/{args[0]}.json
format console
}
}

*.example.com {
log json {
hostnames foo.example.com bar.example.com
}
log console {
hostnames foo.example.com
}
# Subdomains log to multiple files at once, with
# different output files and formats.
import log-both foo.example.com
import log-both bar.example.com
}
----------
{
"logging": {
"logs": {
"console": {
"bar.example.com-console": {
"writer": {
"output": "stdout"
"filename": "/var/log/bar.example.com.json",
"output": "file"
},
"encoder": {
"format": "console"
}
},
"include": [
"http.log.access.bar.example.com-console"
]
},
"json": {
"bar.example.com-json": {
"writer": {
"filename": "/var/log/caddy-json.log",
"filename": "/var/log/bar.example.com.log",
"output": "file"
},
"encoder": {
"format": "json"
}
},
"include": [
"http.log.access.bar.example.com-json"
]
},
"default": {
"exclude": [
"http.log.access.bar.example.com-console",
"http.log.access.bar.example.com-json",
"http.log.access.foo.example.com-console",
"http.log.access.foo.example.com-json"
]
},
"foo.example.com-console": {
"writer": {
"filename": "/var/log/foo.example.com.json",
"output": "file"
},
"encoder": {
"format": "console"
},
"include": [
"http.log.access.foo.example.com-console"
]
},
"foo.example.com-json": {
"writer": {
"filename": "/var/log/foo.example.com.log",
"output": "file"
},
"encoder": {
"format": "json"
},
"include": [
"http.log.access.foo.example.com-json"
]
}
}
},
Expand All @@ -62,11 +101,12 @@
"logs": {
"logger_names": {
"bar.example.com": [
"json"
"bar.example.com-json",
"bar.example.com-console"
],
"foo.example.com": [
"json",
"console"
"foo.example.com-json",
"foo.example.com-console"
]
}
}
Expand Down

0 comments on commit 29c55ab

Please sign in to comment.