Add JSON as access logging format
This commit is contained in:
parent
39388a2199
commit
a9216e24f5
7 changed files with 268 additions and 59 deletions
19
docs/toml.md
19
docs/toml.md
|
@ -42,6 +42,7 @@
|
|||
|
||||
# Access logs file
|
||||
#
|
||||
# Deprecated - see [accessLog] lower down
|
||||
# Optional
|
||||
#
|
||||
# accessLogsFile = "log/access.log"
|
||||
|
@ -151,6 +152,24 @@ Supported filters:
|
|||
# constraints = ["tag==api", "tag!=v*-beta"]
|
||||
```
|
||||
|
||||
## Access log definition
|
||||
|
||||
The standard access log uses the textual Common Log Format (CLF), extended with additional fields.
|
||||
Alternatively logs can be written in JSON.
|
||||
Using the default CLF option is simple, e.g.
|
||||
|
||||
```toml
|
||||
[accessLog]
|
||||
filePath = "/path/to/access.log"
|
||||
```
|
||||
|
||||
To write JSON format logs, specify `json` as the format:
|
||||
```toml
|
||||
[accessLog]
|
||||
filePath = "/path/to/access.log"
|
||||
format = "json"
|
||||
```
|
||||
|
||||
## Entrypoints definition
|
||||
|
||||
```toml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue