nestjs-unilog

<p align="center"> <img alt="NestJS Unilog" src="https://raw.githubusercontent.com/znckco/nestjs-unilog/master/.assets/cover.png"/> </p>

Usage no npm install needed!

<script type="module">
  import nestjsUnilog from 'https://cdn.skypack.dev/nestjs-unilog';
</script>

README

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.