Table of Contents

Class PluginConfigurationExtensions

Namespace
Quartz
Assembly
Quartz.Plugins.dll

Adds the plugins shipped in Quartz.Plugins to a scheduler.

public static class PluginConfigurationExtensions
Inheritance
PluginConfigurationExtensions
Inherited Members

Remarks

Each plugin is registered as an ordinary service, constructed by the container so it gets constructor injection, and then configured from typed options. No plugin is named by a string.

The options are the scheduler's own named options, so a plugin is configurable from appsettings.json like anything else the container builds: services.Configure<FileSchedulingOptions>(configuration.GetSection("…")) reaches the plugin, and the callback passed here is applied over whatever bound onto them. The flat quartz.plugin.<name>.* keys still work and are applied first, so configuration written in code beats the same setting written as a string.

Methods

UseJobHistoryLogging(IQuartzBuilder, Action<JobHistoryLoggingOptions>?)

Logs job execution history using classic numbered format strings.

public static IQuartzBuilder UseJobHistoryLogging(this IQuartzBuilder builder, Action<JobHistoryLoggingOptions>? configure = null)

Parameters

builder IQuartzBuilder
configure Action<JobHistoryLoggingOptions>

Returns

IQuartzBuilder

Remarks

UseStructuredJobLogging(IQuartzBuilder, Action<JobHistoryLoggingOptions>?) is the better default; this one exists for deployments whose log pipeline expects the 3.x message shape.

UseJsonSchedulingConfiguration(IQuartzBuilder, Action<FileSchedulingOptions>)

Loads jobs and triggers from JSON files, optionally rescanning them for changes.

public static IQuartzBuilder UseJsonSchedulingConfiguration(this IQuartzBuilder builder, Action<FileSchedulingOptions> configure)

Parameters

builder IQuartzBuilder
configure Action<FileSchedulingOptions>

Returns

IQuartzBuilder

UseJsonSchedulingConfiguration(IQuartzBuilder, params string[])

Loads jobs and triggers from the named JSON files, read once.

public static IQuartzBuilder UseJsonSchedulingConfiguration(this IQuartzBuilder builder, params string[] files)

Parameters

builder IQuartzBuilder

The scheduler's builder.

files string[]

The files to load, in the plugin's own path syntax — ~/ is the content root.

Returns

IQuartzBuilder

Remarks

The shorthand for the commonest case, which is one file and nothing else to say about it. It adds to Files rather than replacing it, exactly as the callback form's options.Files.Add(…) does, so calling both — or calling this twice — is additive. Rescanning, or any of the other settings, needs the callback overload.

UseStructuredJobLogging(IQuartzBuilder, Action<JobHistoryLoggingOptions>?)

Logs job execution history using structured message templates.

public static IQuartzBuilder UseStructuredJobLogging(this IQuartzBuilder builder, Action<JobHistoryLoggingOptions>? configure = null)

Parameters

builder IQuartzBuilder
configure Action<JobHistoryLoggingOptions>

Returns

IQuartzBuilder

Remarks

The templates name their values — {JobGroup}, {FireTime} — so a structured log pipeline can index them, which is why this is the better default. They are overridable for the same reason the numbered ones are.

UseStructuredTriggerLogging(IQuartzBuilder, Action<TriggerHistoryLoggingOptions>?)

Logs trigger firing history using structured message templates.

public static IQuartzBuilder UseStructuredTriggerLogging(this IQuartzBuilder builder, Action<TriggerHistoryLoggingOptions>? configure = null)

Parameters

builder IQuartzBuilder
configure Action<TriggerHistoryLoggingOptions>

Returns

IQuartzBuilder

Remarks

The templates name their values — {JobGroup}, {FireTime} — so a structured log pipeline can index them, which is why this is the better default. They are overridable for the same reason the numbered ones are.

UseTriggerHistoryLogging(IQuartzBuilder, Action<TriggerHistoryLoggingOptions>?)

Logs trigger firing history using classic numbered format strings.

public static IQuartzBuilder UseTriggerHistoryLogging(this IQuartzBuilder builder, Action<TriggerHistoryLoggingOptions>? configure = null)

Parameters

builder IQuartzBuilder
configure Action<TriggerHistoryLoggingOptions>

Returns

IQuartzBuilder

Remarks

UseStructuredTriggerLogging(IQuartzBuilder, Action<TriggerHistoryLoggingOptions>?) is the better default; this one exists for deployments whose log pipeline expects the 3.x message shape.

UseXmlSchedulingConfiguration(IQuartzBuilder, Action<FileSchedulingOptions>)

Loads jobs and triggers from XML files, optionally rescanning them for changes.

public static IQuartzBuilder UseXmlSchedulingConfiguration(this IQuartzBuilder builder, Action<FileSchedulingOptions> configure)

Parameters

builder IQuartzBuilder
configure Action<FileSchedulingOptions>

Returns

IQuartzBuilder

UseXmlSchedulingConfiguration(IQuartzBuilder, params string[])

Loads jobs and triggers from the named XML files, read once.

public static IQuartzBuilder UseXmlSchedulingConfiguration(this IQuartzBuilder builder, params string[] files)

Parameters

builder IQuartzBuilder

The scheduler's builder.

files string[]

The files to load, in the plugin's own path syntax — ~/ is the content root.

Returns

IQuartzBuilder

Remarks

The shorthand for the commonest case, which is one file and nothing else to say about it. It adds to Files rather than replacing it, exactly as the callback form's options.Files.Add(…) does, so calling both — or calling this twice — is additive. Rescanning, or any of the other settings, needs the callback overload.