Table of Contents

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

systemName string

The 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

string

Name

Gets or sets an optional friendly display name.

public string? Name { get; set; }

Property Value

string

NotificationCategory

Gets or sets an optional filter for log category, or Category|Action pair.

public string? NotificationCategory { get; set; }

Property Value

string

Remarks

  • If the value contains |, it must be exactly Category|Action of 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

string

Remarks

  • Set to MonitoringService to 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

string

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 MonitoringService destination, this value is optional; if empty, the monitoring workflow defaults to Error when querying past events.

NotificationServiceUri

Gets or sets the base URI of the external monitoring service.

public string? NotificationServiceUri { get; set; }

Property Value

string

Remarks

  • Required when NotificationDestination is MonitoringService.
  • Used as the HttpClient.BaseAddress for posting to api/health/setLogEvents.

NotifiedEmails

Gets or sets the email recipients when sending email notifications.

public string? NotifiedEmails { get; set; }

Property Value

string

Remarks

SendInterval

Gets or sets the minimum number of minutes between consecutive notifications sent by this configuration.

public int SendInterval { get; set; }

Property Value

int

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

string

Remarks

  • Used as the filename and cache key (must be unique and a valid file name without spaces).
  • Validate with ValidateSystemName(string) before saving.

See Also

To top