@eropple/nestjs-bunyan-logger

0.1.1 • Public • Published

@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();

/@eropple/nestjs-bunyan-logger/

    Package Sidebar

    Install

    npm i @eropple/nestjs-bunyan-logger

    Weekly Downloads

    112

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    11.9 kB

    Total Files

    13

    Last publish

    Collaborators

    • eropple