1.0.1 • Published 4 years ago

@enigmatis/polaris-nest-logger v1.0.1

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

polaris-nest-logger

Want to use polaris-logger in your nest js app?

You are welcome to use our PolarisNestLoggerModule!

Getting started

  • This module has to be used in a nestjs project, so make sure you have one, and that you have installed @nestjs/core & @nestjs/common
  • run npm install @enigmatis/polaris-nest-logger

Using the module

In your app.module, import the PolarisNestLoggerModule in one of the following ways:

using register method:

@Module({
    imports: [PolarisNestLoggerModule.register(polarisNestLoggerOptions)],
})
export class AppModule{}

The options argument should be of type PolarisNestLoggerOptions.

using registerAsync method:

With registerAsync method you can provide a factory method that will return your configuration, so that the configuration can be generated dynamically using your own providers. For example:

@Module({
    imports: [
        PolarisNestLoggerModule.registerAsync({
            imports: [CommonModule],
            inject: [ApiConfigService],
            useFactory: async (apiConfigService: ApiConfigService): Promise<PolarisNestLoggerOptions> => {
                const applicationProperties: ApplicationProperties = apiConfigService.config.app;
                const loggerConfiguration: LoggerConfiguration = {...apiConfigService.config.logger, loggerLevel: apiConfigService.config.logger.level};
                return {applicationProperties, loggerConfiguration};
            }
        }) 
    ],
})
export class AppModule{}
1.0.1

4 years ago

1.0.1-beta.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.8

4 years ago

1.0.0-beta.6

4 years ago

1.0.0-beta.7

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago