10.0.1 • Published 9 months ago
@edirect/logger v10.0.1
@edirect/logger
The EDirectInsure Logger module.
Installation
$ npm i --save @edirect/loggerUsage
Import and register LoggerModule on AppModule (app.module.ts):
imports: [
...
LoggerModule.register({
output: "output",
logs: {
errorFile: "error_file",
warningFile: "warning_file",
infoFile: "info_file",
},
name: 'subscription-service',
}),
...
]OR
import { ConfigService } from '@edirect/config';
...
imports: [
...
LoggerModule.registerAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
output: configService.get(Variables.LOGS_OUTPUT),
logs: {
errorFile: configService.get(Variables.LOGS_ERROR_FILE),
warningFile: configService.get(Variables.LOGS_WARNING_FILE),
infoFile: configService.get(Variables.LOGS_INFO_FILE),
},
name: 'subscription-service',
}),
inject: [ConfigService],
}),
...
]Inject the LoggerService where needed:
constructor(
private loggerService: LoggerService
) {}Log using the exposed methods:
this.loggerService.log(message: string, payload?: string)
this.loggerService.info(message: string, payload?: string)
this.loggerService.warn(message: string, payload: string)
this.loggerService.error(message: string, trace: string)
this.loggerService.debug(message: string)
this.loggerService.verbose(message: string)9.1.3
9 months ago
10.0.0
1 year ago
10.0.1
9 months ago
9.1.2
3 years ago
9.1.1
3 years ago
9.1.0
3 years ago
9.0.0
4 years ago
2.0.4
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago