Is is possible to get access logs for registered services sent to stdout

Hi folks. I've been trying to get a log of all the traffic for each service in the cluster, in the same way that, say, nginx would output each proxied call for each service.

I've found the env var for enabling access logs for the traefik service itself (TRAEFIK_ACCESSLOG) however this does not seem to give the access logs for registered services.

I'm running a Docker Swarm cluster, redirecting logs from services to stdout means I can push these to Cloudwatch or similar easily.

Any help would be apreciated,

thanks.

Ok I seem to have found my own answer. It was the TRAEFIK_LOG environment variable.

Seems obvious, doesn't it? :slight_smile:

If I could suggest, though, the documentation makes this oddly difficult to find. In the docs it says "logs are sent to stdout by default" but doesn't mention (at the same point in the doc) the fact that logs are disabled by default. This is the sort of thing that can confuse folks. So mentioning the other controlling factors for logs on the same page (Logs - Traefik) might be useful.

thanks.

Actually - I was wrong - these are not access logs after all. We need info such as http status code etc, in order to be able to use the logs. These don't seem to appear in the log enabled by "TRAEFIK_LOG".

any help would be appreciated.

Access log is what you are looking for.

I prefer to use the json format as I find there is more information than the CLF.

See this response for an example of the log output:

Yep that works very well. Thank you so much for the quick reply.