I'm using the predefined build of Docker on Azure (Edge Channel) and one of the features is the logging feature. Checking with docker ps
on the manager node I saw there is this editions_logger
container (docker4x/logger-azure), which catches all the container logs and writes them to an Azure storage account.
How do I use this container directly to get the logs of my containers?
docker exec -ti editions_logger cat /logmnt/xxx.log
docker service logs xxx
throws only supported with experimental daemon
All approaches (not the third one though) seem quite over complicated. Is there a better way?
Another way, we can use --volumes
to store container logs to Host, then use Logstash to collect logs from the volumes.
In the host machine to open a fixed directory D, and mount the logs to the sub-directory of the D directory, then the mount D to Logstash. In this way, the Logstash container can collect all logs from other containers.
It works like this: