solarwinds/papertrail-plugin
This is a plugin for Docker to both send logs to and read logs from Papertrail.
716
()
NOTE: this is considered EXPERIMENTAL and is not yet recommended for production systems.
This is a plugin for Docker to both send logs to and read logs from Papertrail
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.
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"
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.
docker pull solarwinds/papertrail-plugin