UNPKG

nestjs-context-winston

Version:

Contextual Logger for nestjs apps using AsyncLocalStorage and winston

19 lines (18 loc) 841 B
import { NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common'; import { Observable } from 'rxjs'; import { BaseContextLogger } from './base-context-logger'; import { ContextLoggingOptions } from './context-logging-options'; export declare const STATUS_RANGE = 100; export declare const OK_STATUS = 3; export declare const SERVER_ERROR_CATEGORY = 5; export declare class RequestLoggerInterceptor implements NestInterceptor { private readonly logger; private readonly options; private static readonly REQUEST_LOG; constructor(logger: BaseContextLogger<object>, options: ContextLoggingOptions<BaseContextLogger<object>>); intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>; private getStatusCode; private getStatusFamily; private logResponse; private getMethod; }