Skip to content

A winston formatter that prints json lines in elastic common schema format

License

Notifications You must be signed in to change notification settings

firecow/node-filebeat-logger

Repository files navigation

A winston logger that prints json lines in elastic common schema format

build Known Vulnerabilities npm license

Quality Gate Status Maintainability Rating Reliability Rating Security Rating

Coverage Code Smells Duplicated Lines (%)


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"}

About

A winston formatter that prints json lines in elastic common schema format

Topics

Resources

License

Stars

Watchers

Forks