Added duration filter for logs
This commit is contained in:
parent
eac20d61df
commit
1fbf5b84a2
4 changed files with 85 additions and 36 deletions
|
@ -18,6 +18,7 @@ logLevel = "INFO"
|
|||
[accessLog.filters]
|
||||
statusCodes = ["200", "300-302"]
|
||||
retryAttempts = true
|
||||
minDuration = "10ms"
|
||||
|
||||
[accessLog.fields]
|
||||
defaultMode = "keep"
|
||||
|
@ -46,6 +47,7 @@ For more information about the CLI, see the documentation about [Traefik command
|
|||
--accessLog.format="json"
|
||||
--accessLog.filters.statusCodes="200,300-302"
|
||||
--accessLog.filters.retryAttempts="true"
|
||||
--accessLog.filters.minDuration="10ms"
|
||||
--accessLog.fields.defaultMode="keep"
|
||||
--accessLog.fields.names="Username=drop Hostname=drop"
|
||||
--accessLog.fields.headers.defaultMode="keep"
|
||||
|
@ -146,19 +148,26 @@ format = "json"
|
|||
|
||||
[accessLog.filters]
|
||||
|
||||
# statusCodes keep access logs with status codes in the specified range
|
||||
# statusCodes: keep access logs with status codes in the specified range
|
||||
#
|
||||
# Optional
|
||||
# Default: []
|
||||
#
|
||||
statusCodes = ["200", "300-302"]
|
||||
|
||||
# retryAttempts keep access logs when at least one retry happened
|
||||
# retryAttempts: keep access logs when at least one retry happened
|
||||
#
|
||||
# Optional
|
||||
# Default: false
|
||||
#
|
||||
retryAttempts = true
|
||||
|
||||
# minDuration: keep access logs when request took longer than the specified duration
|
||||
#
|
||||
# Optional
|
||||
# Default: 0
|
||||
#
|
||||
minDuration = "10ms"
|
||||
```
|
||||
|
||||
To customize logs format:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue