@ccmos/nestjs-winston-logger
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

winstonjs module for Nest.

Installation

$ npm install @ccmos/nestjs-winston-logger

Quick Start

// import
import { Module } from '@nestjs/common';
import { WinstonLoggerModule } from '@ccmos/nestjs-winston-logger';

@Module({
  imports: [
    WinstonLoggerModule.forRoot({
      level: 'debug'
    }),
  ],
})
export class AppModule {}

// service
import { Injectable } from '@nestjs/common';
import { WinstonLoggerService } from '@ccmos/nestjs-winston-logger';

@Injectable()
export class MyService {
  constructor(
    private logger: WinstonLoggerService,
  ) {
    this.logger.setContext(MyService.name);
  }

  helloWorld() {
    this.logger.info('hello-world.info', { foo: 'bar' });
  }
}

License

Nest is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @ccmos/nestjs-winston-logger

Weekly Downloads

1

Version

0.0.9

License

MIT

Unpacked Size

261 kB

Total Files

39

Last publish

Collaborators

  • mosluce