1.1.1 • Published 7 months ago

@mariomorenodev/nest-response-logger v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Description

Logger global interceptor library for Nest apps

Installation

$ npm install @mariomorenodev/nest-response-logger

Copy the variables from the .env.example file to the .env file

$ cp .env.example .env

Or add variables to the environment

TZ=UTC

LOG_FILE_PATH=./logs/app.log
LOG_FILE_ENABLED=false

Usage

Add the NestResponseLogger service globally in the main.ts file:

import { NestResponseLoggerService } from '@mariomorenodev/nest-response-logger';

import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    logger: new NestResponseLoggerService(),
  });
  await app.listen(3000);
}
bootstrap();

Add the interceptor globally in the app.module.ts file:

import { LoggerInterceptor } from '@mariomorenodev/nest-response-logger';
import { NestResponseLoggerModule } from '@mariomorenodev/nest-response-logger';

@Module({
  imports: [NestResponseLoggerModule],
  providers: [
    AppService,
    {
      provide: APP_INTERCEPTOR,
      useClass: LoggerInterceptor,
    },
  ],
})

License

Nest response logger MIT licensed.

1.1.1

7 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago