Class LogEventNotification
- Namespace
- Dynamicweb.Logging.LogEvents
- Assembly
- Dynamicweb.Core.dll
Represents a persisted configuration that defines when and where to send notifications for newly saved LogEvent instances.
[Serializable]
public class LogEventNotification
- Inheritance
-
LogEventNotification
- Inherited Members
Remarks
Instances are serialized to XML files at /Files/System/EventNotifications/{SystemName}.xml by
LogEventNotificationRepository and cached/served via LogEventNotificationService.
The Dynamicweb.Subscribers.LogEventSavedSubscriber reads these configurations to filter
and dispatch notifications (email or external monitoring service).
Constructors
LogEventNotification(string)
Initializes a new instance of the LogEventNotification class with a system name.
public LogEventNotification(string systemName)
Parameters
systemNamestringThe unique system name (also used as the XML file name).
Properties
Description
Gets or sets an optional description of this configuration.
public string? Description { get; set; }
Property Value
Name
Gets or sets an optional friendly display name.
public string? Name { get; set; }
Property Value
NotificationCategory
Gets or sets an optional filter for log category, or Category|Action pair.
public string? NotificationCategory { get; set; }
Property Value
Remarks
- If the value contains
|, it must be exactlyCategory|Actionof the event. - Otherwise, it must match the event category.
- Matching is exact and case-insensitive.
NotificationDestination
Gets or sets the notification destination.
public string? NotificationDestination { get; set; }
Property Value
Remarks
- Set to
MonitoringServiceto send events to an external health/monitoring endpoint. - Any other value (or empty) results in email notifications using NotifiedEmails.
NotificationLevels
Gets or sets the filter for log levels that should trigger notifications.
public string? NotificationLevels { get; set; }
Property Value
Remarks
- Comma-/separator-delimited list of LogLevel names (e.g.
Error,Warning). - Matching is case-insensitive.
- For email notifications, this must include the event level to match.
- For
MonitoringServicedestination, this value is optional; if empty, the monitoring workflow defaults toErrorwhen querying past events.
NotificationServiceUri
Gets or sets the base URI of the external monitoring service.
public string? NotificationServiceUri { get; set; }
Property Value
Remarks
- Required when NotificationDestination is
MonitoringService. - Used as the
HttpClient.BaseAddressfor posting toapi/health/setLogEvents.
NotifiedEmails
Gets or sets the email recipients when sending email notifications.
public string? NotifiedEmails { get; set; }
Property Value
Remarks
- Used when NotificationDestination is not
MonitoringService. - Multiple emails can be separated by space, comma, semicolon, pipe, or new lines.
- Parsing is handled by SplitEmails(LogEventNotification).
SendInterval
Gets or sets the minimum number of minutes between consecutive notifications sent by this configuration.
public int SendInterval { get; set; }
Property Value
Remarks
- A value less than or equal to 0 disables this configuration.
- Throttling is enforced by Dynamicweb.Subscribers.LogEventSavedSubscriber.
SystemName
Gets or sets the unique system name of this configuration.
public string SystemName { get; set; }
Property Value
Remarks
- Used as the filename and cache key (must be unique and a valid file name without spaces).
- Validate with ValidateSystemName(string) before saving.