1.3.3 • Published 4 months ago
filebeat-logger v1.3.3
A winston logger that prints json lines in elastic common schema format
Install
npm install --save filebeat-logger
Usage
const filebeatLogger = require('filebeat-logger')
const logger = filebeatLogger.create({
logLevel: 'debug', // 'info' by default
printTimestamp: false, // true by default
keysOrder: ['@timestamp', 'message'], // ["@timestamp", "log.level", "message"] by default
stderrLevels: ['warn', 'error'], // ["error", "warn", "warning"] by default
});
logger.info('I am an info message')
// {"@timestamp":"2022-01-30T14:49:00.323Z","message": "I am an info message","log.level":"info"}