nestjs-unilog
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i nestjs-unilog

Weekly Downloads

1

Version

0.5.1

License

MIT

Unpacked Size

91.2 kB

Total Files

9

Last publish

Collaborators

  • znck