Skip to content

Commit

Permalink
Turn on Traefik access logs
Browse files Browse the repository at this point in the history
This will be useful for debugging issues and gathering statistics.

Use the JSON format, since that allows us to include more information than
the traditional HTTP access logs. Switch the other logs to JSON as well, for
ease of parsing.
  • Loading branch information
SpecLad committed Nov 7, 2023
1 parent 630770e commit 7e542b7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog.d/20231107_183551_roman_traefik_logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changed

- The Docker Compose file and Helm chart now enable Traefik access logs by
default, and change the log format to JSON
(<https://github.com/opencv/cvat/pull/7109>)
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ services:
container_name: traefik
restart: always
command:
- '--log.format=json'

- '--accesslog.format=json'
- '--accesslog.fields.defaultmode=drop'
- '--accesslog.fields.names.ClientHost=keep'
- '--accesslog.fields.names.DownstreamContentSize=keep'
- '--accesslog.fields.names.DownstreamStatus=keep'
- '--accesslog.fields.names.Duration=keep'
- '--accesslog.fields.names.RequestAddr=keep'
- '--accesslog.fields.names.RequestMethod=keep'
- '--accesslog.fields.names.RequestPath=keep'
- '--accesslog.fields.names.RequestProtocol=keep'
- '--accesslog.fields.names.RequestProtocol=keep'
- '--accesslog.fields.names.RouterName=keep'
- '--accesslog.fields.names.StartUTC=keep'

- '--providers.docker.exposedByDefault=false'
- '--providers.docker.network=cvat'
- '--entryPoints.web.address=:8080'
Expand Down
21 changes: 21 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,27 @@ traefik:
service:
externalIPs:
# - "192.168.49.2"
logs:
general:
format: json
access:
enabled: true
format: json
fields:
general:
defaultmode: drop
names:
ClientHost: keep
DownstreamContentSize: keep
DownstreamStatus: keep
Duration: keep
RequestAddr: keep
RequestMethod: keep
RequestPath: keep
RequestProtocol: keep
RequestProtocol: keep
RouterName: keep
StartUTC: keep

smokescreen:
opts: ''

0 comments on commit 7e542b7

Please sign in to comment.