feat(status-dashboard): configure JSON logger for production
Configure NestJS to use JsonLoggerService for structured logging: - JSON format for SIEM integration - Consistent log format across application - Production-ready logging infrastructure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4e64600f52
commit
c5cfa6108c
1 changed files with 6 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|||
import { IoAdapter } from '@nestjs/platform-socket.io';
|
||||
import * as fs from 'fs';
|
||||
import { AppModule } from './app.module';
|
||||
import { JSONLoggerService } from './logging';
|
||||
|
||||
// Registry service is optional (requires workspace build)
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
@ -81,9 +82,13 @@ function getMtlsOptions(): MtlsOptions | undefined {
|
|||
|
||||
async function bootstrap() {
|
||||
const httpsOptions = getMtlsOptions();
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
// Use JSON logger in production for SIEM integration
|
||||
const logger = isProduction ? new JSONLoggerService() : undefined;
|
||||
|
||||
const app = await NestFactory.create(AppModule, {
|
||||
logger: getLogLevels(),
|
||||
logger: logger || getLogLevels(),
|
||||
...(httpsOptions && { httpsOptions }),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue