feat: access logs #126

Open
fauno wants to merge 4 commits from access-log into master
4 changed files with 31 additions and 1 deletions
+5
View File
@@ -225,3 +225,8 @@ WRITE_TIMEOUT=0s
## Enable onion service support
#ONION_ENABLED=1
## Keep access logs on a volume.
# You'll need to setup rotation yourself and send the USR1 signal to
Review

Can you give an example of how to setup the log rotation?

Can you give an example of how to setup the log rotation?
# Traefik for reloading.
#COMPOSE_FILE="$COMPOSE_FILE:compose.access-log.yml"
+1 -1
View File
@@ -1,3 +1,3 @@
export TRAEFIK_YML_VERSION=v32
export TRAEFIK_YML_VERSION=v33
export FILE_PROVIDER_YML_VERSION=v12
export ENTRYPOINT_VERSION=v5
+10
View File
@@ -0,0 +1,10 @@
---
version: "3.8"
services:
app:
environment:
ACCESS_LOG_ENABLED: "true"
volumes:
- "access-logs:/var/log/"
volumes:
access-logs:
+15
View File
@@ -6,6 +6,21 @@ log:
level: {{ env "LOG_LEVEL" }}
maxAge: {{ env "LOG_MAX_AGE" }}
{{ if eq (env "ACCESS_LOG_ENABLED") "true" }}
accessLog:
format: "json"
filePath: "/var/log/access_log.jsonl"
fields:
defaultMode: "keep"
headers:
defaultMode: "keep"
names:
Authorization: "drop"
Cookie: "drop"
queryParameters:
defaultMode: "keep"
{{ end }}
providers:
swarm:
endpoint: "tcp://socket-proxy:2375"