Traefik
GeoMetrikks parses Traefik JSON access logs. Traefik logs to stdout by default, so configure a file and the JSON format in your static configuration, and keep the User-Agent and Referer headers so analytics have them:
accessLog: filePath: "/var/log/traefik/access.log" format: json fields: headers: names: User-Agent: keep Referer: keepMount the log directory into the GeoMetrikks container (set
ACCESS_LOG_DIR=/path/to/traefik/logs in .env, or edit the volume) and
point the parser at it:
ACCESS_LOG_DIR=/var/log/traefikLOGPARSER_LOG_PATHS=/var/log/access/access.logThe format is auto-detected per file; set LOGPARSER_LOG_FORMATS=traefik-json
to pin it. Notes:
- Rotate with logrotate and signal Traefik afterwards:
docker kill --signal=USR1 traefik. GeoMetrikks follows the rotation. - Behind a CDN or load balancer, configure Traefik’s
entryPoints.<name>.forwardedHeaders.trustedIPsso the logged client IP is the real client, not the proxy. With a trusted peer, Traefik logs theX-Forwarded-Forchain as it arrived; GeoMetrikks takes the rightmost entry, the one your proxy appended. Do not setforwardedHeaders.insecure: it trusts the header from anyone, and a client can then place any address on the map. Seedocs/proxy-setup.mdfor the full real-IP setup, including tunnels. - A file path is required; GeoMetrikks cannot read Traefik’s stdout.