+ public static getLog(): LogConfiguration {
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logEnabled',
+ undefined,
+ "Use 'log' section to define the logging enablement instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logFile',
+ undefined,
+ "Use 'log' section to define the log file instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logErrorFile',
+ undefined,
+ "Use 'log' section to define the log error file instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logConsole',
+ undefined,
+ "Use 'log' section to define the console logging enablement instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logStatisticsInterval',
+ undefined,
+ "Use 'log' section to define the log statistics interval instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logLevel',
+ undefined,
+ "Use 'log' section to define the log level instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logFormat',
+ undefined,
+ "Use 'log' section to define the log format instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logRotate',
+ undefined,
+ "Use 'log' section to define the log rotation enablement instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logMaxFiles',
+ undefined,
+ "Use 'log' section to define the log maximum files instead"
+ );
+ Configuration.warnDeprecatedConfigurationKey(
+ 'logMaxSize',
+ undefined,
+ "Use 'log' section to define the log maximum size instead"
+ );
+ const defaultLogConfiguration: LogConfiguration = {
+ enabled: true,
+ file: 'logs/combined.log',
+ errorFile: 'logs/error.log',
+ statisticsInterval: Constants.DEFAULT_LOG_STATISTICS_INTERVAL,
+ level: 'info',
+ format: 'simple',
+ rotate: true,
+ };
+ const deprecatedLogConfiguration: LogConfiguration = {
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logEnabled') && {
+ enabled: Configuration.getConfig()?.logEnabled,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logFile') && {
+ file: Configuration.getConfig()?.logFile,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logErrorFile') && {
+ errorFile: Configuration.getConfig()?.logErrorFile,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logStatisticsInterval') && {
+ statisticsInterval: Configuration.getConfig()?.logStatisticsInterval,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logLevel') && {
+ level: Configuration.getConfig()?.logLevel,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logConsole') && {
+ console: Configuration.getConfig()?.logConsole,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logFormat') && {
+ format: Configuration.getConfig()?.logFormat,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logRotate') && {
+ rotate: Configuration.getConfig()?.logRotate,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logMaxFiles') && {
+ maxFiles: Configuration.getConfig()?.logMaxFiles,
+ }),
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'logMaxSize') && {
+ maxSize: Configuration.getConfig()?.logMaxSize,
+ }),
+ };
+ const logConfiguration: LogConfiguration = {
+ ...defaultLogConfiguration,
+ ...deprecatedLogConfiguration,
+ ...(Utils.hasOwnProp(Configuration.getConfig(), 'log') && Configuration.getConfig()?.log),
+ };
+ return logConfiguration;
+ }
+
+ public static getWorker(): WorkerConfiguration {