New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lite-logger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lite-logger

A super-light JSON logger. Meant to be used in conjunction with a proper log aggregator.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-lite-logger

A lite logger inspired by https://strongloop.com/strongblog/automatic-node-js-clustering-with-log-aggregation/ which pushes data out as JSON instead of raw text, a la bunyan.

To be used in conjunction with a proper log aggregator, such as LogEntries or Fluent.

The more you log, the less time you spend fighting fires and the more time you spend developing real features.

To use:

logger = require('lite-logger');
logger.info({foo: 'bar'}, 'ASDF');

Outputs:

{loglevel: 'INFO', msg: 'ASDF', foo: 'bar'}

In general:

logger.info(contextObject, message)

  • contextObject should be a key-value hash
  • message should be a string
  • both arguments are required

Configuration:

Don't want to read JSON during development? Environment variables to the rescue!

NODE_LITE_LOGGER_PLAINTEXT=true node app.js

Now, you'll get:

[INFO] ASDF, {
    foo: bar
}

Methods

logger.trace

logger.debug

logger.info

logger.warn

logger.error

logger.fatal

FAQs

Package last updated on 12 Aug 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc