JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q41296F
  • License MIT

a lightweight and graceful logger for nodejs based on `log` and `rotating-file-stream`

Package Exports

  • log-tracer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (log-tracer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

log-tracer

lightweight logger for node.js heavily inspired by log and rotating-file-stream

Features

  • default file output
  • optional console output
  • file rotation support
  • log reader support
  • cluster mode support

Usage

install

npm i log-tracer --save

import

var log = require('log-tracer')()

arguments

  • levelStr {String} debug default

Details with an object which have following attributes:

  • logName {String} trace.log default
  • path {String} parent dir of the logfiles, better to be an absolue path. ./trace default
  • size {String} rotation size for the file. '20M' default
  • maxFiles {Number} max number of files to be stored. 10 default
  • replaceConsole {Boolean} disable console output. true default

Exapmle

var log = require('log-tracer')();

log.debug('debug message');
log.info('info message');
log.error('error message');

log levels

  • 0 EMERGENCY system is unusable
  • 1 ALERT action must be taken immediately
  • 2 CRITICAL the system is in critical condition
  • 3 ERROR error condition
  • 4 WARNING warning condition
  • 5 NOTICE a normal but significant condition
  • 6 INFO a purely informational message
  • 7 DEBUG messages to debug an application

License

MIT