winston-logfmt
v1.0.0
Published
logfmt formatter for winston
Downloads
765
Readme
winston-logfmt
This module provides a custom logfmt winston format and a simple logger instance creator.
Usage
Simple logfmt logger:
import { createLogger } from "winston-logfmt";
export const logger = createLogger();
// ...
logger.info("hello world");
Customize the logger:
export const logger = createLogger({
meta: {
serviceName: "awesome-service"
},
transports: [
// default to console transport
],
extraFormatters: [
// add any additional formatter you'd like to use here
]
});
Custom implementation: (more info)[https://github.com/winstonjs/winston#usage]
import winston from "winston";
import { logFmtFormat } from "winston-logfmt";
export const logger = winston.createLogger({
format: logFmtFormat(),
});