Installations
npm install docker-logentries
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
0.10.36
NPM Version
2.11.1
Score
60.9
Supply Chain
89.9
Quality
76.2
Maintenance
50
Vulnerability
99.3
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (61.7%)
Makefile (35.25%)
Dockerfile (3.04%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
nearform
Download Statistics
Total Downloads
3,679
Last Day
2
Last Week
11
Last Month
30
Last Year
142
GitHub Statistics
108 Stars
84 Commits
58 Forks
67 Watching
2 Branches
236 Contributors
Bundle Size
185.44 kB
Minified
39.73 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.3.1
Package Id
docker-logentries@0.3.1
Size
193.29 kB
NPM Version
2.11.1
Node Version
0.10.36
Total Downloads
Cumulative downloads
Total Downloads
3,679
Last day
-50%
2
Compared to previous day
Last week
-26.7%
11
Compared to previous week
Last month
150%
30
Compared to previous month
Last year
-4.7%
142
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
docker-logentries
Forward all your logs to LogEntries, like a breeze.
See the Logentries community pack at http://revelops.com/community/packs/docker/.
Usage as a Container
The simplest way to forward all your container's log to LogEntries is to run this repository as a container, with:
1docker run -v /var/run/docker.sock:/var/run/docker.sock logentries/docker-logentries -t <TOKEN> -j -a host=`uname -n`
You can also use two different tokens for logging and stats:
1docker run -v /var/run/docker.sock:/var/run/docker.sock logentries/docker-logentries -l <LOGSTOKEN> -k <STATSTOKEN> -j -a host=`uname -n`
You can also pass the --no-stats
flag if you do not want stats to be
published to logentries every second. You need this flag for Docker
version < 1.5.
You can also pass the --no-logs
flag if you do not want logs to be
published to logentries.
You can also filter filter the containers for whitch the logs/stats are forwarded with:
--matchByName REGEXP
: forward logs/stats only for the containers whose name matches the given REGEXP.--matchByImage REGEXP
: forward logs/stats only for the containers whose image matches the given REGEXP.--skipByName REGEXP
: do not forward logs/stats for the containers whose name matches the given REGEXP.--skipByImage REGEXP
: do not forward logs/stats for the containers whose image matches the given REGEXP.
Running container in a restricted environment.
Some environments(such as Google Compute Engine) does not allow to access the docker socket without special privileges. You will get EACCES(Error: read EACCES
) error if you try to run the container.
To run the container in such environments add --privileged to the docker run
command.
Example:
1docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock logentries/docker-logentries -t <TOKEN> -j -a host=`uname -n`
Usage as a CLI
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'.
You can also filter filter the containers for whitch the logs/stats are forwarded with:
--matchByName REGEXP
: forward logs/stats only for the containers whose name matches the given REGEXP.--matchByImage REGEXP
: forward logs/stats only for the containers whose image matches the given REGEXP.--skipByName REGEXP
: do not forward logs/stats for the containers whose name matches the given REGEXP.--skipByImage REGEXP
: do not forward logs/stats for the containers whose image matches the given REGEXP.
Embedded usage
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
// the following options limit the containers being matched
// so we can avoid catching logs for unwanted containers
matchByName: /hello/, // optional
matchByImage: /matteocollina/, //optional
skipByName: /.*pasteur.*/, //optional
skipByImage: /.*dockerfile.*/ //optional
})
// logentries is the source stream with all the
// log lines
setTimeout(function() {
logentries.destroy()
}, 5000)
Building a docker repo from this repository
First clone this repository, then:
1docker build -t logentries . 2docker run -v /var/run/docker.sock:/var/run/docker.sock logentries -t <TOKEN> -j -a host=`uname -n`
How it works
This module wraps four Docker APIs:
POST /containers/{id}/attach
, to fetch the logsGET /containers/{id}/stats
, to fetch the stats of the containerGET /containers/json
, to detect the containers that are running when this module startsGET /events
, to detect new containers that will start after the module has started
This module wraps docker-loghose and docker-stats to fetch the logs and the stats as a never ending stream of data.
All the originating requests are wrapped in a never-ending-stream.
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 11/19 approved changesets -- score normalized to 5
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
- Warn: branch protection not enabled for branch 'alpine-base'
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: containerImage not pinned by hash: Dockerfile:5: pin your Docker image by updating node:0.12-onbuild to node:0.12-onbuild@sha256:533305c976e8977a8833284cc86ab4b564f11816d52a6f9ad6cf492ffc975131
- Warn: containerImage not pinned by hash: Dockerfile.alpine:5: pin your Docker image by updating mhart/alpine-node:5.10.1 to mhart/alpine-node:5.10.1@sha256:e92e16bed77e505193df7123daf57c09e98304cda560e8ee4902cae695161058
- Warn: npmCommand not pinned by hash: Dockerfile:10
- Warn: npmCommand not pinned by hash: Dockerfile.alpine:11
- Info: 0 out of 2 containerImage dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More