@finastra/nestjs-logger
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

NestJS Logger module Nest Logo

NestJS module to log in specific formats :

  • Azure Monitor (previously OMS)

Use it

Import the logger module in your main module

app.module.ts

@Module({
  imports: [
    LoggerModule,
    ...
  ],
})
export class AppModule {}

Define which module to use in the bootstrapping of your app :

main.ts

const omsLogger = new OMSLogger();
const app = await NestFactory.create(AppModule, {
  logger: ['warn', 'log', 'error'],
});
app.useLogger(omsLogger);
app.useGlobalInterceptors(new HttpLoggingInterceptor());

GraphQL

If you're using GraphQL in your application, there's another interceptor for you :

app.useGlobalInterceptors(new GraphQLLoggingInterceptor());

Readme

Keywords

none

Package Sidebar

Install

npm i @finastra/nestjs-logger

Weekly Downloads

5

Version

0.4.1

License

MIT

Unpacked Size

164 kB

Total Files

27

Last publish

Collaborators

  • david.bocle
  • ffdcbot
  • ttalbot