Skip to content

znckco/nestjs-unilog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jun 20, 2022
350e0ea · Jun 20, 2022

History

22 Commits
Oct 7, 2020
Oct 7, 2020
Jun 20, 2022
Jun 20, 2022
Oct 7, 2020
Oct 7, 2020
Oct 7, 2020
Oct 7, 2020
Oct 7, 2020
Oct 7, 2020
Oct 7, 2020
Jan 25, 2022
Oct 7, 2020
Jun 20, 2022
Jan 25, 2022
Oct 7, 2020
Jun 20, 2022
Jan 25, 2022

Repository files navigation

NestJS Unilog

NestJS Unilog

NPM Contributor Covenant CI codecov

Description

Unilog is request context logger for NestJS.

Installation

$ npm install --save nestjs-unilog

Quick Start

import { UnilogModule, RequestContextLogger } from "nestjs-unilog"
import { Module } from "@nestjs/common"
import { NestFactory } from "@nestjs/core"

// 1. Register  UnilogModule
@Module({ imports: [UnilogModule] })
class AppModule {}

async function bootstrap() {
  const app = await NestFactory.create(AppModule)
  
  // 2. Use RequestContextLogger
  app.useLogger(app.get(RequestContextLogger))

  await app.listen(3000)
}

bootstrap()

Stay in touch

License

NestJS Unilog is MIT licensed.