-
Notifications
You must be signed in to change notification settings - Fork 0
net90_EventLogHelper_SmartEventLogger_LogEntry
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper
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. |
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.
- enum LoggingSeverity
- class SmartEventLogger
- namespace EventLogHelper
- assembly EventLogHelper