[core] Print original error, not pino one

This commit is contained in:
devlikepro committed 2024-08-04 10:09:32 +07:00
1 parent 5f02f49e9d
commit cb0e59e91a
1 file changed
+6
+6
View File
@@ -7,6 +7,7 @@ import {
} from '@waha/utils/logging';
import { json, urlencoded } from 'express';
import { Logger as NestJSPinoLogger } from 'nestjs-pino';
import { LoggerErrorInterceptor } from 'nestjs-pino';
import { Logger } from 'pino';
import pino from 'pino';
@@ -60,6 +61,11 @@ async function bootstrap() {
bufferLogs: true,
});
app.useLogger(app.get(NestJSPinoLogger));
// Print original stack, not pino one
// https://github.com/iamolegga/nestjs-pino?tab=readme-ov-file#expose-stack-trace-and-error-class-in-err-property
app.useGlobalInterceptors(new LoggerErrorInterceptor());
app.enableShutdownHooks();
app.useGlobalFilters(new AllExceptionsFilter());
app.enableCors();