A progressive Node.js framework for building efficient and scalable server-side applications.
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.