@loglayer/transport-bunyan
v1.0.8
Published
Bunyan transport for loglayer.
Downloads
633
Maintainers
Readme
Bunyan Transport for LogLayer
The Bunyan transport for LogLayer.
Bunyan is a JSON logging library for Node.js services.
Installation
npm install loglayer @loglayer/transport-bunyan bunyan
Usage
import bunyan from 'bunyan'
import { LogLayer } from 'loglayer'
import { BunyanTransport } from "@loglayer/transport-bunyan"
const b = bunyan.createLogger({
name: "my-logger",
level: "trace", // Show all log levels
serializers: {
err: bunyan.stdSerializers.err // Use Bunyan's error serializer
}
})
const log = new LogLayer({
errorFieldName: "err", // Match Bunyan's error field name
transport: new BunyanTransport({
logger: b
})
})
Documentation
For more details, visit https://loglayer.dev/transports/bunyan