A Docker logging driver for shipping logs to Timber
Switch branches/tags
Nothing to show
Clone or download
carkmorwin Prepare v0.1.1 release
  - Update `VERSION` file
  - Rollup changes in `CHANGELOG.md`
  - Update `README.md` to reflect new version number
Latest commit d24e877 Nov 12, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
.dockerignore
.gitignore
CHANGELOG.md
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
README.md
VERSION
config.json
driver.go
http.go
logger.go
main.go
plugin_install.sh
plugin_uninstall.sh

README.md

Timber Docker logging driver

Built by Timber.io

GitHub release license

The Timber Docker logging driver is a Docker logging plugin for collecting Docker container logs and shipping them to Timber.io.

Only container logs on stdout and stderr will be collected and shipped.

  1. Installation
  2. Usage
  3. Configuration
  4. Contributing

Installation

To install the Timber Docker logging plugin on a host:

docker plugin install timberio/docker-logging-driver:0.1.1 --alias timber

To verify the plugin is installed and enabled:

docker plugin ls
ID                  NAME                DESCRIPTION             ENABLED
64dc540271a0        timber:latest       Timber logging driver   true

Uninstall

To remove the Timber Docker loggin plugin on a host:

docker plugin disable timber
docker plugin rm timber

Usage

Docker logging drivers can be used in two ways, on a per container basis or for every container on a host.

Both options require a Timber API key. If you need a key go here.

Per Container

To use the Timber Docker logging driver on a single container, run the container with the following options:

docker run --log-driver timber \
  --log-opt timber-api-key="{{my-timber-api-key}}" \
  CONTAINER_NAME

Here my-timber-api-key is your Timber API key and CONTAINER_NAME is the container to run.

Per Host

To use the Timber Docker logging driver for all containers on a running on a host, you will need to configure the Docker daemon.

Assuming the host system is Linux:

  1. Add the necessary configuration to /etc/docker/daemon.json replacing my-timber-api-key with your API key

    {
      "log-driver": "timber",
      "log-opts": {
        "timber-api-key": "{{my-timber-api-key}}"
      }
    }
  2. Restart the Docker daemon

    sudo service docker restart

Configuration

These are the supported Timber Docker logging driver options, and can be set with the Docker --log-opt flag.

Option Required? Default Value Description
timber-api-key yes Timber API key

Contributing

This project uses Dep as the dependency manager and all vendorized dependencies are committed into version control. If you make a change that includes a new dependency, please make sure to add it to the dependency manager properly. You can do this by editing the Gopkg.toml file in the root of the project (format documentation). After editing the file, run dep ensure to update the vendor folder.

It is recommended to test the plugin on a docker-machine environment or one where you can access the docker logs easily. Verbose logging can also be turned on by setting the LOG_LEVEL environment variable to debug.

To build and install the plugin locally from source:

./plugin install
ID                  NAME                DESCRIPTION             ENABLED
1d046b706212        timber:latest       Timber logging driver   true

To run a container with the plugin:

docker run --log-driver timber \
  --log-opt timber-api-key="{{my-timber-api-key}}" \
  --env LOG_LEVEL="debug"
  CONTAINER_NAME

To uninstall the plugin locally:

./plugin uninstall