0.0.5 • Published 2 years ago

@seas-computing/nestjs-logging v0.0.5

Weekly downloads
-
License
BSD-3
Repository
github
Last release
2 years ago

NestJS Logging

The nestjs-logging package provides a NestJS logging module that logs a reasonable set of messages by default but also provides a number of methods for logging in common use cases. The package uses the Winston logging library under the hood.

Usage

We must configure the log module by specifying a log level. To do this, we pass in an argument of type WINSTON_LOG_LEVEL to the module's register method. For example, to set the log level to WINSTON_LOG_LEVEL.INFO, the AppModule, a consuming module, we would have an imports property in which the log level is passed in to the register method like so:

@Module({
  imports: [LogModule.register(WINSTON_LOG_LEVEL.INFO)],
  controllers: [
    UserController,
    HealthCheckController,
  ],
  providers: [],
})