Add APPLICATION_LOG_DRIVER=CONSOLE to twenty-app-dev container (#19600)
## Summary - Enable application log console output in the `twenty-app-dev` Docker image by adding `APPLICATION_LOG_DRIVER=CONSOLE` to the Dockerfile ENV block - Rename `APPLICATION_LOG_DRIVER_TYPE` to `APPLICATION_LOG_DRIVER` and `ApplicationLogDriverType` to `ApplicationLogDriver` for consistency with all other driver config variables (`EMAIL_DRIVER`, `LOGGER_DRIVER`, `CAPTCHA_DRIVER`, etc.) - Add `APPLICATION_LOG_DRIVER` to `.env.example`
This commit is contained in:
+3
-3
@@ -1,14 +1,14 @@
|
||||
import { type TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
|
||||
|
||||
import { type OPTIONS_TYPE } from 'src/engine/core-modules/application-logs/application-logs.module-definition';
|
||||
import { ApplicationLogDriverType } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver-type.enum';
|
||||
import { ApplicationLogDriver } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.enum';
|
||||
|
||||
export const applicationLogsModuleFactory = async (
|
||||
twentyConfigService: TwentyConfigService,
|
||||
): Promise<typeof OPTIONS_TYPE> => {
|
||||
const driverType = twentyConfigService.get('APPLICATION_LOG_DRIVER_TYPE');
|
||||
const driverType = twentyConfigService.get('APPLICATION_LOG_DRIVER');
|
||||
|
||||
return {
|
||||
type: driverType as ApplicationLogDriverType,
|
||||
type: driverType as ApplicationLogDriver,
|
||||
};
|
||||
};
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@ import { ApplicationLogsService } from 'src/engine/core-modules/application-logs
|
||||
import { ClickHouseApplicationLogDriver } from 'src/engine/core-modules/application-logs/drivers/clickhouse.driver';
|
||||
import { ConsoleApplicationLogDriver } from 'src/engine/core-modules/application-logs/drivers/console.driver';
|
||||
import { DisabledApplicationLogDriver } from 'src/engine/core-modules/application-logs/drivers/disabled.driver';
|
||||
import { ApplicationLogDriverType } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver-type.enum';
|
||||
import { ApplicationLogDriver } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.enum';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
@@ -64,13 +64,13 @@ export class ApplicationLogsModule extends ConfigurableModuleClass {
|
||||
}
|
||||
|
||||
private static createDriver(
|
||||
type: ApplicationLogDriverType,
|
||||
type: ApplicationLogDriver,
|
||||
clickHouseService?: ClickHouseService,
|
||||
) {
|
||||
switch (type) {
|
||||
case ApplicationLogDriverType.CONSOLE:
|
||||
case ApplicationLogDriver.CONSOLE:
|
||||
return new ConsoleApplicationLogDriver();
|
||||
case ApplicationLogDriverType.CLICKHOUSE:
|
||||
case ApplicationLogDriver.CLICKHOUSE:
|
||||
if (!clickHouseService) {
|
||||
throw new Error(
|
||||
'ClickHouseService is required for the ClickHouse application log driver',
|
||||
@@ -78,7 +78,7 @@ export class ApplicationLogsModule extends ConfigurableModuleClass {
|
||||
}
|
||||
|
||||
return new ClickHouseApplicationLogDriver(clickHouseService);
|
||||
case ApplicationLogDriverType.DISABLED:
|
||||
case ApplicationLogDriver.DISABLED:
|
||||
default:
|
||||
return new DisabledApplicationLogDriver();
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export enum ApplicationLogDriverType {
|
||||
export enum ApplicationLogDriver {
|
||||
DISABLED = 'DISABLED',
|
||||
CONSOLE = 'CONSOLE',
|
||||
CLICKHOUSE = 'CLICKHOUSE',
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { type ApplicationLogDriverType } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver-type.enum';
|
||||
import { type ApplicationLogDriver } from 'src/engine/core-modules/application-logs/interfaces/application-log-driver.enum';
|
||||
|
||||
export type ApplicationLogsModuleOptions = {
|
||||
type: ApplicationLogDriverType;
|
||||
type: ApplicationLogDriver;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user