Forward all your logs to logentries, like a breeze.
TODO:
- publish on NPM
- publish on Docker Hub
- update readme with Docker HUB and NPM details
npm install docker-logentries -g
docker-logentries -t TOKEN -a host=\
uname -n``- ..there is no step 3
You can also pass the -j
switch if you log in JSON format, like
bunyan.
You can also pass the --no-stats
flag if you do not want stats to be
published to logentries every second.
The -a/--add
flag allows to add fixed values to the data being
published. This follows the format 'name=value'.
Install it with: npm install docker-logentries --save
Then, in your JS file:
var logentries = require('docker-logentries')({
json: false, // or true to parse lines as JSON
secure: false, // or true to connect securely
token: process.env.TOKEN, // logentries TOKEN
stats: true, // disable stats if false
add: null, // an object whose properties will be added
})
// logentries is the source stream with all the
// log lines
setTimeout(function() {
logentries.destroy()
}, 5000)
First clone this repository, then:
docker build -t docker-logentries .
docker run -v /var/run/docker.sock:/var/run/docker.sock docker-logentries -t <TOKEN> -j -a host=`uname -n`
MIT