Gelf formatted log files.
npm install gelf-file- file
String: The path for the log file. - opts
Object:- logLevel : The log level for the application.
- timestamp The format for the timestamp. See time-stamp
- args
Object: An object containing parameters that should be added to each log entry.
Mirror that of syslog:
0EMERGENCYsystem unusable1ALERTimmediate action required2CRITICALcondition critical3ERRORcondition error4WARNINGcondition warning5NOTICEcondition normal, but significant6INFOa purely informational message7DEBUGdebugging information
const logger = require('gelf-file')('./app.log', {logLevel: 'WARNING'}, {app: 'my-app'});
logger.log('DEBUG', 'started app');- logLevel
String- The desired log level. Valid values are listed in the log level list above. - message
String- The log message. - tags
Object- Additional information to store with the log message.
log(logLevel, message, tags)- Creates a log entry for the desired log level.emergency(message, tags)- Creates an emergency log entry.alert(message, tags)- Creates an alert log entry.critical(message, tags)- Creates an critical log entry.error(message, tags)- Creates an error log entry.warning(message, tags)- Creates an warning log entry.notice(message, tags)- Creates an notice log entry.info(message, tags)- Creates an info log entry.debug(message, tags)- Creates an debug log entry.
This project was inspired by log
