feat(core): Increase Cron observability (#17626)

This commit is contained in:
Iván Ovejero
2025-07-28 11:54:33 +02:00
committed by GitHub
parent 921cdb6fd0
commit 08c38a76f3
12 changed files with 175 additions and 40 deletions

View File

@@ -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.
*

View File

@@ -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']);

View File

@@ -275,6 +275,9 @@ describe('GlobalConfig', () => {
location: 'logs/n8n.log',
},
scopes: [],
cron: {
activeInterval: 0,
},
},
multiMainSetup: {
enabled: false,