Skip to content

iondrive/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@iondrive/logger

A 12-factor logging module for Node.js/io.js.

Build Status

Principles

  • Log to stdout. The environment should manage how logs are routed and stored.
  • Log as JSON, allowing machines to read the log output.

Install

npm install @iondrive/logger

Usage

Logging level

The logging level can be set with the environment variable NODE_LOG_LEVEL or LOG_LEVEL. The value can be one of trace, debug, info, warn, error or fatal. The default level is info.

Example

var log = require('@iondrive/logger');

log.info('hello');

// The following will log the error fields and stack trace
log.info(err);
log.info(err, 'Something broke');

Formatting

All logger methods use util.format and thus can use placeholder formatting.

log.debug('hello from %s', 'iondrive'); // 'hello from iondrive'

License

MIT

About

A 12-factor logging module for Node.js/io.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published