Socket
Socket
Sign inDemoInstall

log4bro

Package Overview
Dependencies
165
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    log4bro

easy ELK logger with compliant output format, based on bunyan.


Version published
Weekly downloads
527
increased by94.46%
Maintainers
1
Install size
25.6 MB
Created
Weekly downloads
 

Readme

Source

log4bro

Build Status

  • 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

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

Keywords

FAQs

Last updated on 13 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc