Public | Automated Build

Last pushed: 3 years ago
Short Description
Short description is empty for this repo.
Full Description

Aldis, a log forwarder for Docker.

Aldis connects to Docker's remote API and attaches containers as they are created to forward logs to an AMQP exchange.

This is a temporary solution while waiting for a more standard way of handling container output in Docker, but it works. I'm not even sure you should use this.


Docker specifics

Aldis is ran through a Docker container and must have access to the /var/run/docker.sock of the Docker daemon you want to manage:

docker run -v /var/run/docker.sock:/var/run/docker.sock stage1/aldis

Aldis can not connect to a Docker daemon via TCP.

You also need to specify the AMQP host to connect to, either through the -a option or the ALDIS_AMQP_HOST environment var:

docker run -v /var/run/docker.sock:/var/run/docker.sock stage1/aldis -a
docker run -v /var/run/docker.sock:/var/run/docker.sock -e ALDIS_AMQP_HOST=localhost stage1/aldis

Aldis options

Use the -h option to get a listing of all available options:

-a, --amqp=ARG      AMQP host
-e, --exchange=ARG  exchange to publish messages to
-E, --env=ARG+      env variables to include in pipe
-A, --attach        attach already running containers
-l, --log           output logs as they arrive
-h, --help          show this help
-v, --version       show program version

By default, Aldis will forward all logs to an aldis exchange on the specified AMQP host.

You can also include arbitrary environment variables from the container, using the -E switch (only environment variables defined in the container's configuration are available though).

Receiving messages

Messages will contain a JSON structure looking like this:

{ container:   (string)    container id,
  fragment_id: (int)       an auto-increment id for this message,
  env:         (array)     an array of env variables from the container,
  type:        (int)       stream type (0 = stdin, 1 = stdout, 2 = stderr),
  length:      (int)       the byte length of the log line,
  content:     (string)    actual log line,
  timestamp:   (string)    the time at which aldis received the log line }
Docker Pull Command
Source Repository