@eropple/nestjs-bunyan-logger
This package provides a NestJS LoggerService
that uses
Bunyan under the hood.
Example
Just create a BunyanLoggerService
with your preferred root logger and pass it
to the logger
option of NestFactory.create()
.
import { NestFactory } from '@nestjs/core';
import * as Bunyan from "bunyan";
import { BunyanLoggerService } from "@eropple/nestjs-bunyan-logger";
import { AppModule } from './app.module';
const ROOT_LOGGER = Bunyan.createLogger({ name: "mycoolapp", level: Bunyan.DEBUG });
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: new BunyanLoggerService(ROOT_LOGGER)
});
await app.listen(3000);
}
bootstrap();