1.5.1 • Published 1 year ago

@nest-toolbox/winston-logger v1.5.1

Weekly downloads
90
License
MIT
Repository
github
Last release
1 year ago

Winston Logger Service

NestJS LoggerService that uses Winston.

Installation

npm i @nest-toolbox/winston-logger

Example

You can pass any custom transports supported by Winston

import { NestFactory } from '@nestjs/core';
import { WinstonLoggerService } from '@nest-toolbox/winston-logger';
import { AppModule } from './app.module';
import * as winston from 'winston';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(
    ApplicationModule,
    {
      logger: new WinstonLoggerService({
        projectName: 'project',
      }),
    },
  );

  const app = await NestFactory.create<NestExpressApplication>(
    ApplicationModule,
    {
      logger: new WinstonLoggerService({
        projectName: 'project',
        transports: [
          new winston.transports.File({
            filename: 'combined.log',
            level: 'info',
          }),
        ],
      }),
    },
  );

  await app.listen(3000);
}
bootstrap();

WinstonLoggerService constructor options

options: {
  projectName: string,
  transports?: any[],
  timeFormatStr?: string,
  customFormatter?: any
}
1.5.1

1 year ago

1.4.19

2 years ago

1.4.17

2 years ago

1.4.6

2 years ago

1.4.9

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.1.20

4 years ago

1.1.18

4 years ago

1.1.11

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago