@ccmos/nestjs-winston-logger
v0.0.9
Published
<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> </p>
Downloads
11
Readme
Description
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.