Forward all your Docker logs to Logz.io
10M+
The simplest way to forward all your container's log to Logz.io is to run this repository as a container, with:
docker run -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock logzio/logzio-docker -t <YourLogz.ioToken> -a env=prod
You can pass the --no-stats flag if you do not want stats to be
published to Logz.io every second. You need this flag for Docker
version < 1.5.
You can pass the --no-logs flag if you do not want logs to be published to Logz.io.
You can pass the --no-dockerEvents flag if you do not want events to be
published to Logz.io.
The -i/--statsinterval <STATSINTERVAL> downsamples the logs sent to Logz.io. It collects samples and averages them before sending to Logz.io.
The -a allows to add more fields to the log - this can be used to tag spesific application, enviroment etc.
The -z allows to contorol to which zone the logs will be sent to eu for Europe us for USA (set to us by default)
You can also pass the -j switch if all of the logs generated in the containers are in JSON format
You can also filter the containers for which the logs/stats are forwarded with:
--matchByName REGEXP: forward logs/stats only for the containers whose name matches the given REGEXP.--matchByImage REGEXP: forward logs/stats only for the containers whose image matches the given REGEXP.--skipByName REGEXP: do not forward logs/stats for the containers whose name matches the given REGEXP.--skipByImage REGEXP: do not forward logs/stats for the containers whose image matches the given REGEXP.Some environments(such as Google Compute Engine) does not allow to access the docker socket without special privileges. You will get EACCES(Error: read EACCES) error if you try to run the container.
To run the container in such environments add --privileged to the docker run command.
Example:
docker run --privileged -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock logzio/logzio-docker -t ***TOKEN*** -a env=prod
This container wraps four Docker APIs:
POST /containers/{id}/attach, to fetch the logsGET /containers/{id}/stats, to fetch the stats of the containerGET /containers/json, to detect the containers that are running when
this module startsGET /events, to detect new containers that will start after the
module has startedThis module wraps docker-loghose and docker-stats to fetch the logs and the stats as a never ending stream of data.
Content type
Image
Digest
Size
21.7 MB
Last updated
over 7 years ago
docker pull logzio/logzio-docker