Class NotificationMethodBase
Provides a base class for health check notification methods.
Inheritance
object
Namespace: Umbraco.Cms.Core.HealthChecks.NotificationMethods
Assembly: Umbraco.Core.dll
Syntax
public abstract class NotificationMethodBase : IHealthCheckNotificationMethod, IDiscoverable
Constructors
View SourceNotificationMethodBase(IOptionsMonitor<HealthChecksSettings>)
Initializes a new instance of the NotificationMethodBase class.
Declaration
protected NotificationMethodBase(IOptionsMonitor<HealthChecksSettings> healthCheckSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IOptionsMonitor<HealthChecksSettings> | healthCheckSettings | The health check settings monitor. |
Properties
View SourceEnabled
Gets a value indicating whether this notification method is enabled.
Declaration
public bool Enabled { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
FailureOnly
Gets or sets a value indicating whether notifications should only be sent on failure.
Declaration
public bool FailureOnly { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
Settings
Gets the settings dictionary for this notification method.
Declaration
public IDictionary<string, string>? Settings { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, string> |
Verbosity
Gets or sets the verbosity level for the notification.
Declaration
public HealthCheckNotificationVerbosity Verbosity { get; protected set; }
Property Value
| Type | Description |
|---|---|
| HealthCheckNotificationVerbosity |
Methods
View SourceSendAsync(HealthCheckResults)
Sends the health check results via this notification method.
Declaration
public abstract Task SendAsync(HealthCheckResults results)
Parameters
| Type | Name | Description |
|---|---|---|
| HealthCheckResults | results | The health check results to send. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
ShouldSend(HealthCheckResults)
Determines whether a notification should be sent based on the results and configuration.
Declaration
protected bool ShouldSend(HealthCheckResults results)
Parameters
| Type | Name | Description |
|---|---|---|
| HealthCheckResults | results | The health check results. |
Returns
| Type | Description |
|---|---|
| bool |
|