-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: Implement
append
encoder, allow flatter filters config (#6069
) * logging: Implement `add` encoder * Allow flatter config structure for `filter` & `add` * Rename to append * govulncheck was unhappy
- Loading branch information
1 parent
1f4a6fa
commit 01d5568
Showing
7 changed files
with
476 additions
and
34 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
63 changes: 63 additions & 0 deletions
63
caddytest/integration/caddyfile_adapt/log_append_encoder.caddyfiletest
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,63 @@ | ||
{ | ||
log { | ||
format append { | ||
wrap json | ||
fields { | ||
wrap "foo" | ||
} | ||
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", | ||
"wrap": "foo" | ||
}, | ||
"format": "append", | ||
"wrap": { | ||
"format": "json" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":80" | ||
], | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "Hello, World!", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.