Search code examples
azureloggingdockerdocker-swarm

Docker Swarm on Azure: Correct use of docker4x/logger-azure


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?

  1. My first approach was to find the right storage and share and download the logs directly from the Azure portal.
  2. The second approach was to connect to the container directly using docker exec -ti editions_logger cat /logmnt/xxx.log
  3. Running 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?


Solution

  • 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:
    enter image description here