Skip to content

net90_EventLogHelper_SmartEventLogger_LogEntry

dparvin edited this page Sep 10, 2025 · 4 revisions

SmartEventLogger.LogEntry method (1 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (2 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, byte[] rawData)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
rawData Optional binary data to associate with the log entry. This can be null if unused.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (3 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (4 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, int eventID)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (5 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (6 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, short category)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (7 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, byte[] rawData, 
    LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
rawData Optional binary data to associate with the log entry. This can be null if unused.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (8 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    byte[] rawData)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
rawData Optional binary data to associate with the log entry. This can be null if unused.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (9 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (10 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (11 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    short category)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (12 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, int eventID, 
    LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (13 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, short category, 
    LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (14 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    byte[] rawData, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
rawData Optional binary data to associate with the log entry. This can be null if unused.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (15 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, byte[] rawData)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
rawData Optional binary data to associate with the log entry. This can be null if unused.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (16 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (17 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, short category)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (18 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    short category, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (19 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, byte[] rawData, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
rawData Optional binary data to associate with the log entry. This can be null if unused.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (20 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, short category, byte[] rawData)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.
rawData Optional binary data to associate with the log entry. This can be null if unused.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (21 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, short category, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also


SmartEventLogger.LogEntry method (22 of 22)

Writes a log entry to the specified EventLog with the given parameters.

public static void LogEntry(this EventLog eventLog, string message, EventLogEntryType eventType, 
    int eventID, short category, byte[] rawData, LoggingSeverity EntrySeverity)
parameter description
eventLog The EventLog instance to which the entry will be written. This must be properly initialized with a valid log name and source.
message The message to log. If null or empty, a default message is used. If AllowMultiEntryMessages is false (default), messages longer than 32,766 characters are truncated and suffixed with the TruncationMarker (e.g., "... [TRUNCATED]"). If AllowMultiEntryMessages is true, long messages are split into multiple event entries, each prefixed with part information (e.g., [Part 1/3]) and intermediate entries are suffixed with the ContinuationMarker (e.g., " ...") to indicate continuation.
eventType The type of event. Valid values are Error, Warning, and Information. If invalid, Information is used.
eventID A numeric identifier for the event. This value is application-defined and can be used for categorizing or filtering related log entries.
category A numeric category for the event. This is typically used in categorized views of the Event Log. Use 0 if no category is needed.
rawData Optional binary data to associate with the log entry. This can be null if unused.
EntrySeverity Indicates the importance or severity of this log entry relative to the configured logging threshold (CurrentLoggingLevel). If the severity is lower than the current logging level, the entry will be skipped and not written to the Event Log.

Remarks

This method uses configured or default values for formatting and fallbacks. The message is normalized and validated prior to writing. If you are using a test environment, an alternate writer can be configured to intercept and test log output without writing to the system Event Log.

See Also

Clone this wiki locally