Disable buffered logs (#3892)
* Update main.ts * Update command.ts * Update queue-worker.ts * Enable users to disable log buffering --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -18,7 +18,7 @@ async function bootstrap() {
|
||||
};
|
||||
|
||||
const app = await CommandFactory.createWithoutRunning(CommandModule, {
|
||||
bufferLogs: true,
|
||||
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||
errorHandler,
|
||||
serviceErrorHandler: errorHandler,
|
||||
});
|
||||
|
||||
@ -236,6 +236,10 @@ export class EnvironmentService {
|
||||
);
|
||||
}
|
||||
|
||||
getLoggerIsBufferEnabled(): boolean | undefined {
|
||||
return this.configService.get<boolean>('LOGGER_IS_BUFFER_ENABLED') ?? true;
|
||||
}
|
||||
|
||||
getExceptionHandlerDriverType(): ExceptionHandlerDriver {
|
||||
return (
|
||||
this.configService.get<ExceptionHandlerDriver>(
|
||||
|
||||
@ -16,7 +16,7 @@ import { EnvironmentService } from './integrations/environment/environment.servi
|
||||
const bootstrap = async () => {
|
||||
const app = await NestFactory.create(AppModule, {
|
||||
cors: true,
|
||||
bufferLogs: true,
|
||||
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||
});
|
||||
const logger = app.get(LoggerService);
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ async function bootstrap() {
|
||||
|
||||
try {
|
||||
const app = await NestFactory.createApplicationContext(QueueWorkerModule, {
|
||||
bufferLogs: true,
|
||||
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||
});
|
||||
|
||||
loggerService = app.get(LoggerService);
|
||||
|
||||
Reference in New Issue
Block a user