Skip to content

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: keep

Mount 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/traefik
LOGPARSER_LOG_PATHS=/var/log/access/access.log

The 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.trustedIPs so the logged client IP is the real client, not the proxy. With a trusted peer, Traefik logs the X-Forwarded-For chain as it arrived; GeoMetrikks takes the rightmost entry, the one your proxy appended. Do not set forwardedHeaders.insecure: it trusts the header from anyone, and a client can then place any address on the map. See docs/proxy-setup.md for the full real-IP setup, including tunnels.
  • A file path is required; GeoMetrikks cannot read Traefik’s stdout.