librato/docker-plugin-papertrail

Name: docker-plugin-papertrail

Owner: Librato

Description: A Docker plugin for Papertrail to send and read container logs. As a SolarWinds Innovation Project, this adapter is supported in a best-effort fashion.

Forked from: solarwinds/docker-plugin-papertrail

Created: 2018-02-19 17:06:09.0

Updated: 2018-02-19 17:06:11.0

Pushed: 2018-02-19 17:08:23.0

Homepage: https://hub.docker.com/r/solarwinds/papertrail-plugin/

Size: 7892

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

(CircleCI)

NOTE: this is considered EXPERIMENTAL and is not yet recommended for production systems.

docker-plugin-papertail

This is a plugin for Docker to both send logs to and read logs from Papertrail

What is it?

Once configured, it will send your Docker logs to Papertrail, buffer logs in the event of network disconnect as well as enable reading of remote logs from Papertrail through docker logs CLI.

Why not the docker syslog driver?
How to use it?

Prerequisites:

Install the plugin:

docker plugin install solarwinds/papertrail-plugin

The plugin needs to use the host network for sending logs to paper trail. Please accept the permission.

Plugin "solarwinds/papertrail-plugin" is requesting the following privileges:
 - network: [host]
Do you grant the above permissions? [y/N] y

Once installed, we need to configure docker to use the plugin.

Configuration options available are:

If you want to configure a specific container to use the driver, you can use the “–log-driver” and “–log-opt” options to docker run like this example below:

docker run --rm --log-driver solarwinds/papertrail-plugin --log-opt papertrail-url=logsX.papertrailapp.com:XXXXX \
    --log-opt papertrail-token=adbdyxendkkxk ubuntu bash -c 'while true; do date +%s%N | sha256sum | base64 | head -c 32 ; echo " - Hello world"; sleep 10; done'

To configure the Docker daemon to default to this logging driver, set the value of log-driver to “solarwinds/papertrail-plugin” of the logging driver in the daemon.json file, which is located in /etc/docker/ on Linux hosts or C:\ProgramData\docker\config\ on Windows server hosts. The following example explicitly sets the default logging driver to solarwinds/papertrail-plugin:

{
  "log-driver": "solarwinds/papertrail-plugin",
  "log-opts": {
    "papertrail-url": "logsX.papertrailapp.com:XXXXX",
    "papertrail-token": "adbdyxendkkxk",
    "papertrail-log-retention": "4h",
    "papertrail-max-diskusage": "10"
  }
}

For viewing the logs:

docker logs "container name"

Tail the logs:

docker logs -f "container name"

Only view the last N lines:

docker logs --tail N "container name"

Start tailing from the last N lines:

docker logs --tail N -f "container name"

Questions/Comments?

Please open an issue, we'd love to hear from you. As a SolarWinds Innovation Project, this plugin is supported in a best-effort fashion.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.