Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/micro-tools/log4bro
log4bro makes it hassle free to have compliant microservice ELK log behaviour
https://github.com/micro-tools/log4bro
access-logs correlation elastic json kibana log logging logstash
Last synced: about 2 months ago
JSON representation
log4bro makes it hassle free to have compliant microservice ELK log behaviour
- Host: GitHub
- URL: https://github.com/micro-tools/log4bro
- Owner: micro-tools
- License: mit
- Created: 2016-04-27T15:32:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:20:11.000Z (about 2 years ago)
- Last Synced: 2024-09-19T00:52:26.617Z (4 months ago)
- Topics: access-logs, correlation, elastic, json, kibana, log, logging, logstash
- Language: JavaScript
- Homepage:
- Size: 704 KB
- Stars: 6
- Watchers: 6
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# log4bro
[![Build Status](https://travis-ci.org/micro-tools/log4bro.svg?branch=master)](https://travis-ci.org/micro-tools/log4bro)
- log4bro makes it hassle free to have compliant microservice ELK stack log behaviour
- just require & init and log via global variable in a few seconds
- you can run in production mode to automatically switch log-levels
- you can run in dockerMode to stop logfile writing and change output to json fields
- you can attach some extra fields to json logs so that they are also loved by your ELK stack and your sysops
- node + docker + log4bro = happy you, happy ELK stack and happy sysops
- comes batteries included for express.js users (check /examples/express_example.js)
- auto. access log in ELK format (cout or file)
- switch log-level dynamically example: `global.LOG.changeLogLevel("INFO");`# simple example
```es6
const Logger = require("log4bro");const options = {
productionMode: true, //switches loglevel between DEBUG and WARN
logDir: "logs", //relative directory to write log file to
silence: false, //silences logger
loggerName: "dev", //ignore
dockerMode: true, //disables output to logfile
varKey: "LOG" //name of global variable
};const logger = new Logger(options);
LOG.trace("bla");
LOG.debug("bla");
LOG.info("bla");
LOG.warn("bla");
LOG.error("bla");
LOG.fatal("bla");
```[Read More Here](docs/more.md)