0.0.1 • Published 10 years ago

winston-logentries-config v0.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
10 years ago

This is a logging configuration module for apps that want to log to file and to logentries.com. It makes use of winston to do the main logging and the node-logentries module to handle the logging to logentries. This is a very simple module that does not make use of winston Transports or anything like that. It simply allows yoou to configure logging using a single log config object.

This module will configure logging using winston that prints logs to console, file and logentries.com, depending on the configuration information passed to the module.

The module takes a config object that can pass in the folowing values: { file: { location: "", / Location of the log file. Optional, defaults to default.log if not set / level: "" / Level of logging required for the file log. Optional, defaults to debug / }, logentries: { key: "", / logentries key. Required for logging to be sent to logentries / level: "" / Level of logging required for logentries. Optional, defaults to info / } }

The module is initialised by calling: require('logentries-winston')() - this will set up console and default file logging

It can then be called with any falvour of the config as well, for example: require('logentries-winston')({file: {location: 'my-log-name.log', level: 'info'}, logentries: {key: '1234554646', level: 'error'}})

This will set up logging to a file called my-log-name.log at a level of info. It will also log to logentries.com with a level of error. Finally, it will log to the console with a level of info.