Skip to content

Commit

Permalink
logging: Implement add encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Jan 28, 2024
1 parent e1b9a9d commit 2e09727
Show file tree
Hide file tree
Showing 2 changed files with 402 additions and 0 deletions.
61 changes: 61 additions & 0 deletions caddytest/integration/caddyfile_adapt/log_add_encoder.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
log {
format add {
wrap json
fields {
env {env.EXAMPLE}
int 1
float 1.1
bool true
string "string"
}
}
}
}

:80 {
respond "Hello, World!"
}
----------
{
"logging": {
"logs": {
"default": {
"encoder": {
"fields": {
"bool": true,
"env": "{env.EXAMPLE}",
"float": 1.1,
"int": 1,
"string": "string"
},
"format": "add",
"wrap": {
"format": "json"
}
}
}
}
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":80"
],
"routes": [
{
"handle": [
{
"body": "Hello, World!",
"handler": "static_response"
}
]
}
]
}
}
}
}
}
Loading

0 comments on commit 2e09727

Please sign in to comment.