A winston logger that prints json lines in elastic common schema format
npm install --save filebeat-logger
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"}