mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(core): Increase Cron observability (#17626)
This commit is contained in:
@@ -19,10 +19,22 @@ export const LOG_SCOPES = [
|
||||
'insights',
|
||||
'workflow-activation',
|
||||
'ssh-client',
|
||||
'cron',
|
||||
] as const;
|
||||
|
||||
export type LogScope = (typeof LOG_SCOPES)[number];
|
||||
|
||||
@Config
|
||||
export class CronLoggingConfig {
|
||||
/**
|
||||
* Interval in minutes to log currently active cron jobs. Set to `0` to disable.
|
||||
*
|
||||
* @example `N8N_LOG_CRON_ACTIVE_INTERVAL=30` will log active crons every 30 minutes.
|
||||
*/
|
||||
@Env('N8N_LOG_CRON_ACTIVE_INTERVAL')
|
||||
activeInterval: number = 0;
|
||||
}
|
||||
|
||||
@Config
|
||||
class FileLoggingConfig {
|
||||
/**
|
||||
@@ -79,6 +91,9 @@ export class LoggingConfig {
|
||||
@Nested
|
||||
file: FileLoggingConfig;
|
||||
|
||||
@Nested
|
||||
cron: CronLoggingConfig;
|
||||
|
||||
/**
|
||||
* Scopes to filter logs by. Nothing is filtered by default.
|
||||
*
|
||||
|
||||
@@ -51,6 +51,7 @@ export { MfaConfig } from './configs/mfa.config';
|
||||
export { HiringBannerConfig } from './configs/hiring-banner.config';
|
||||
export { PersonalizationConfig } from './configs/personalization.config';
|
||||
export { NodesConfig } from './configs/nodes.config';
|
||||
export { CronLoggingConfig } from './configs/logging.config';
|
||||
|
||||
const protocolSchema = z.enum(['http', 'https']);
|
||||
|
||||
|
||||
@@ -275,6 +275,9 @@ describe('GlobalConfig', () => {
|
||||
location: 'logs/n8n.log',
|
||||
},
|
||||
scopes: [],
|
||||
cron: {
|
||||
activeInterval: 0,
|
||||
},
|
||||
},
|
||||
multiMainSetup: {
|
||||
enabled: false,
|
||||
|
||||
Reference in New Issue
Block a user