nestlibs-winston-logger
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

nestlibs-winston-logger

This package is for self use. Feel free to use it if you find it useful.
A simple wrapper around the winston logger with daily log rotation To log messages to file in NestJS application.

Installation

npm install nestlibs-winston-logger

Usage

import { LoggerModule } from '@nestlibs/winston-logger';

@Module({
  // appName will be used as logs folder name (logs/appName/***.log)
  imports: [LoggerModule.forRoot('appName', options)],
})
export class AppModule {}
import { LoggerService } from '@nestlibs/winston-logger';

@Injectable()
export class AppService {
  constructor(private readonly logger: LoggerService) {
    this.logger.log('Hello World!');
  }
}

Options

Methods

type LogError = string | Error;

  • log(message: LogError)
  • info(message: LogError)
  • error(message: LogError, trace?: string)
  • warn(message: LogError)
  • debug(message: LogError)
  • verbose(message: LogError)

Dependents (0)

Package Sidebar

Install

npm i nestlibs-winston-logger

Weekly Downloads

0

Version

0.1.4

License

none

Unpacked Size

11.4 kB

Total Files

11

Last publish

Collaborators

  • desmondhiew