Skip to content

Commit c2911f8

Browse files
committed
fix: buffer logs
1 parent b0e0a58 commit c2911f8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

apps/api/src/main.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ import { ConfigurationService } from './configuration/configuration.service';
1212
import { setupDocs } from './docs';
1313

1414
async function bootstrap() {
15-
const logger = new JSONLogger(null, { debug: true, verbose: true });
16-
const app = await NestFactory.create<NestExpressApplication>(AppModule, { logger });
17-
18-
app.enableShutdownHooks();
19-
15+
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
16+
bufferLogs: true
17+
});
2018
const configurationService = app.get(ConfigurationService);
21-
logger.setOptions({
19+
const logger = new JSONLogger(null, {
2220
debug: configurationService.get('DEBUG'),
2321
verbose: configurationService.get('VERBOSE')
2422
});
25-
23+
app.useLogger(logger);
2624
app.enableCors();
25+
app.enableShutdownHooks();
2726
app.enableVersioning({
2827
defaultVersion: '1',
2928
type: VersioningType.URI

0 commit comments

Comments
 (0)