mirror of
https://github.com/lingble/twenty.git
synced 2025-12-17 21:17:15 +00:00
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:
@@ -146,6 +146,7 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
<OptionTable options={[
|
<OptionTable options={[
|
||||||
['LOGGER_DRIVER', 'console', "The logging driver can be: 'console' or 'sentry'"],
|
['LOGGER_DRIVER', 'console', "The logging driver can be: 'console' or 'sentry'"],
|
||||||
|
['LOGGER_IS_BUFFER_ENABLED', 'true', 'Buffer the logs before sending them to the logging driver'],
|
||||||
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
['LOG_LEVELS', 'error,warn', "The loglevels which are logged to the logging driver. Can include: 'log', 'warn', 'error'"],
|
||||||
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
['EXCEPTION_HANDLER_DRIVER', 'sentry', "The exception handler driver can be: 'console' or 'sentry'"],
|
||||||
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
['SENTRY_DSN', 'https://xxx@xxx.ingest.sentry.io/xxx', 'The sentry logging endpoint used if sentry logging driver is selected'],
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ SIGN_IN_PREFILLED=true
|
|||||||
# SUPPORT_FRONT_HMAC_KEY=replace_me_with_front_chat_verification_secret
|
# SUPPORT_FRONT_HMAC_KEY=replace_me_with_front_chat_verification_secret
|
||||||
# SUPPORT_FRONT_CHAT_ID=replace_me_with_front_chat_id
|
# SUPPORT_FRONT_CHAT_ID=replace_me_with_front_chat_id
|
||||||
# LOGGER_DRIVER=console
|
# LOGGER_DRIVER=console
|
||||||
|
# LOGGER_IS_BUFFER_ENABLED=true
|
||||||
# EXCEPTION_HANDLER_DRIVER=sentry
|
# EXCEPTION_HANDLER_DRIVER=sentry
|
||||||
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
# SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx
|
||||||
# LOG_LEVELS=error,warn
|
# LOG_LEVELS=error,warn
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ async function bootstrap() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const app = await CommandFactory.createWithoutRunning(CommandModule, {
|
const app = await CommandFactory.createWithoutRunning(CommandModule, {
|
||||||
bufferLogs: true,
|
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||||
errorHandler,
|
errorHandler,
|
||||||
serviceErrorHandler: 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 {
|
getExceptionHandlerDriverType(): ExceptionHandlerDriver {
|
||||||
return (
|
return (
|
||||||
this.configService.get<ExceptionHandlerDriver>(
|
this.configService.get<ExceptionHandlerDriver>(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { EnvironmentService } from './integrations/environment/environment.servi
|
|||||||
const bootstrap = async () => {
|
const bootstrap = async () => {
|
||||||
const app = await NestFactory.create(AppModule, {
|
const app = await NestFactory.create(AppModule, {
|
||||||
cors: true,
|
cors: true,
|
||||||
bufferLogs: true,
|
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||||
});
|
});
|
||||||
const logger = app.get(LoggerService);
|
const logger = app.get(LoggerService);
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ async function bootstrap() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const app = await NestFactory.createApplicationContext(QueueWorkerModule, {
|
const app = await NestFactory.createApplicationContext(QueueWorkerModule, {
|
||||||
bufferLogs: true,
|
bufferLogs: process.env.LOGGER_IS_BUFFER_ENABLED === 'true',
|
||||||
});
|
});
|
||||||
|
|
||||||
loggerService = app.get(LoggerService);
|
loggerService = app.get(LoggerService);
|
||||||
|
|||||||
Reference in New Issue
Block a user