< Summary - EventLogHelper Code Coverage

Information
Class: EventLogHelper.SmartEventLogger
Assembly: EventLogHelper
File(s): c:\agent\_work\12\s\Code\EventLogHelper\EventLogHelper\SmartEventLogger.vb
Tag: EventLogHelper Build_2025.10.2.3_#570
Line coverage
100%
Covered lines: 1857
Uncovered lines: 0
Coverable lines: 1857
Total lines: 6626
Line coverage: 100%
Branch coverage
100%
Covered branches: 90
Total branches: 90
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 7/24/2025 - 11:19:20 PM Line coverage: 100% (164/164) Branch coverage: 100% (26/26) Total lines: 685 Tag: EventLogHelper Build_2025.7.24.11_#5198/2/2025 - 3:24:15 PM Line coverage: 100% (604/604) Branch coverage: 100% (36/36) Total lines: 2024 Tag: EventLogHelper Build_2025.8.2.1_#5448/2/2025 - 7:24:10 PM Line coverage: 100% (604/604) Branch coverage: 100% (36/36) Total lines: 2045 Tag: EventLogHelper Build_2025.8.2.2_#5458/3/2025 - 11:25:05 PM Line coverage: 100% (733/733) Branch coverage: 100% (36/36) Total lines: 2542 Tag: EventLogHelper Build_2025.8.3.1_#5468/7/2025 - 12:14:34 AM Line coverage: 100% (793/793) Branch coverage: 100% (60/60) Total lines: 3006 Tag: EventLogHelper Build_2025.8.7.1_#5488/10/2025 - 6:37:00 PM Line coverage: 100% (1010/1010) Branch coverage: 100% (76/76) Total lines: 3560 Tag: EventLogHelper Build_2025.8.10.1_#5498/16/2025 - 2:28:27 AM Line coverage: 100% (1792/1792) Branch coverage: 100% (84/84) Total lines: 6437 Tag: EventLogHelper Build_2025.8.16.1_#5508/17/2025 - 8:10:12 PM Line coverage: 100% (1818/1818) Branch coverage: 100% (92/92) Total lines: 6513 Tag: EventLogHelper Build_2025.8.17.1_#5529/8/2025 - 12:45:09 AM Line coverage: 100% (1838/1838) Branch coverage: 100% (82/82) Total lines: 6587 Tag: EventLogHelper Build_2025.9.8.1_#5569/10/2025 - 8:30:32 AM Line coverage: 100% (1861/1861) Branch coverage: 100% (90/90) Total lines: 6625 Tag: EventLogHelper Build_2025.9.10.2_#5599/30/2025 - 8:29:34 PM Line coverage: 100% (1857/1857) Branch coverage: 100% (90/90) Total lines: 6626 Tag: EventLogHelper Build_2025.9.30.4_#565 7/24/2025 - 11:19:20 PM Line coverage: 100% (164/164) Branch coverage: 100% (26/26) Total lines: 685 Tag: EventLogHelper Build_2025.7.24.11_#5198/2/2025 - 3:24:15 PM Line coverage: 100% (604/604) Branch coverage: 100% (36/36) Total lines: 2024 Tag: EventLogHelper Build_2025.8.2.1_#5448/2/2025 - 7:24:10 PM Line coverage: 100% (604/604) Branch coverage: 100% (36/36) Total lines: 2045 Tag: EventLogHelper Build_2025.8.2.2_#5458/3/2025 - 11:25:05 PM Line coverage: 100% (733/733) Branch coverage: 100% (36/36) Total lines: 2542 Tag: EventLogHelper Build_2025.8.3.1_#5468/7/2025 - 12:14:34 AM Line coverage: 100% (793/793) Branch coverage: 100% (60/60) Total lines: 3006 Tag: EventLogHelper Build_2025.8.7.1_#5488/10/2025 - 6:37:00 PM Line coverage: 100% (1010/1010) Branch coverage: 100% (76/76) Total lines: 3560 Tag: EventLogHelper Build_2025.8.10.1_#5498/16/2025 - 2:28:27 AM Line coverage: 100% (1792/1792) Branch coverage: 100% (84/84) Total lines: 6437 Tag: EventLogHelper Build_2025.8.16.1_#5508/17/2025 - 8:10:12 PM Line coverage: 100% (1818/1818) Branch coverage: 100% (92/92) Total lines: 6513 Tag: EventLogHelper Build_2025.8.17.1_#5529/8/2025 - 12:45:09 AM Line coverage: 100% (1838/1838) Branch coverage: 100% (82/82) Total lines: 6587 Tag: EventLogHelper Build_2025.9.8.1_#5569/10/2025 - 8:30:32 AM Line coverage: 100% (1861/1861) Branch coverage: 100% (90/90) Total lines: 6625 Tag: EventLogHelper Build_2025.9.10.2_#5599/30/2025 - 8:29:34 PM Line coverage: 100% (1857/1857) Branch coverage: 100% (90/90) Total lines: 6626 Tag: EventLogHelper Build_2025.9.30.4_#565

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
SetWriter(...)100%11100%
SetWriter(...)100%11100%
SetRegistryReader(...)100%11100%
SetRegistryReader(...)100%11100%
Initialize()100%88100%
Initialize()100%88100%
InitializeConfiguration()100%11100%
InitializeConfiguration()100%11100%
Reset()100%11100%
Reset()100%11100%
get_MachineName()100%11100%
get_MachineName()100%11100%
set_MachineName(...)100%11100%
set_MachineName(...)100%11100%
get_LogName()100%11100%
get_LogName()100%11100%
set_LogName(...)100%11100%
set_LogName(...)100%11100%
get_SourceName()100%11100%
get_SourceName()100%11100%
set_SourceName(...)100%11100%
set_SourceName(...)100%11100%
get_MaxKilobytes()100%11100%
get_MaxKilobytes()100%11100%
set_MaxKilobytes(...)100%11100%
set_MaxKilobytes(...)100%11100%
get_RetentionDays()100%11100%
get_RetentionDays()100%11100%
set_RetentionDays(...)100%11100%
set_RetentionDays(...)100%11100%
get_WriteInitEntry()100%11100%
get_WriteInitEntry()100%11100%
set_WriteInitEntry(...)100%11100%
set_WriteInitEntry(...)100%11100%
get_TruncationMarker()100%11100%
get_TruncationMarker()100%11100%
set_TruncationMarker(...)100%11100%
set_TruncationMarker(...)100%11100%
get_ContinuationMarker()100%11100%
get_ContinuationMarker()100%11100%
set_ContinuationMarker(...)100%11100%
set_ContinuationMarker(...)100%11100%
get_AllowMultiEntryMessages()100%11100%
get_AllowMultiEntryMessages()100%11100%
set_AllowMultiEntryMessages(...)100%11100%
set_AllowMultiEntryMessages(...)100%11100%
get_IsInitialized()100%11100%
get_IsInitialized()100%11100%
get_IncludeSourceInMessage()100%11100%
get_IncludeSourceInMessage()100%11100%
set_IncludeSourceInMessage(...)100%11100%
set_IncludeSourceInMessage(...)100%11100%
get_CurrentLoggingLevel()100%11100%
get_CurrentLoggingLevel()100%11100%
set_CurrentLoggingLevel(...)100%11100%
set_CurrentLoggingLevel(...)100%11100%
get_LoggingSeverity()100%11100%
get_LoggingSeverity()100%11100%
set_LoggingSeverity(...)100%11100%
set_LoggingSeverity(...)100%11100%
get_SourceResolutionBehavior()100%11100%
get_SourceResolutionBehavior()100%11100%
set_SourceResolutionBehavior(...)100%11100%
set_SourceResolutionBehavior(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%11100%
Log(...)100%1010100%
Log(...)100%1010100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%11100%
LogEntry(...)100%88100%
LogEntry(...)100%88100%
Source(...)100%88100%
Source(...)100%8894.73%
DefaultSource(...)100%11100%
DefaultSource(...)100%11100%
DefaultSource(...)100%11100%
DefaultSource(...)100%11100%
MaxSource(...)100%44100%
MaxSource(...)100%44100%
IsSourceRegisteredToLog(...)100%11100%
IsSourceRegisteredToLog(...)100%11100%
CanReadRegistryForLogAndSource(...)100%11100%
CanReadRegistryForLogAndSource(...)100%11100%
CanReadRegistryForLog(...)100%11100%
CanReadRegistryForLog(...)100%11100%
NormalizeMessage(...)100%1212100%
NormalizeMessage(...)100%1212100%
SplitMessageIntoPages(...)100%1414100%
SplitMessageIntoPages(...)100%1414100%
NormalizeEventType(...)100%44100%
NormalizeEventType(...)100%44100%
NormalizeMachineName(...)100%44100%
NormalizeMachineName(...)100%44100%
GetAppSetting(...)100%44100%
GetAppSetting(...)100%44100%
GetAppSetting(...)100%22100%
GetAppSetting(...)100%22100%
GetAppSetting(...)100%22100%
GetAppSetting(...)100%22100%
GetAppSetting(...)100%44100%
GetAppSetting(...)100%44100%
GetLog()100%11100%
GetLog()100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%
GetLog(...)100%11100%

File(s)

c:\agent\_work\12\s\Code\EventLogHelper\EventLogHelper\SmartEventLogger.vb

#LineLine coverage
 1Imports Microsoft.Win32
 2Imports System.Reflection
 3Imports System.Runtime.CompilerServices
 4Imports EventLogHelper.Enums
 5Imports EventLogHelper.Interfaces
 6Imports System.Globalization
 7
 8#If NETFRAMEWORK Then
 9Imports System.Configuration
 10#Else
 11Imports System.IO
 12Imports Microsoft.Extensions.Configuration
 13#End If
 14
 15''' <summary>
 16''' Provides high-level utilities for logging to the Windows Event Log in a simplified and customizable way.
 17''' </summary><remarks>
 18''' <para>
 19''' This module abstracts common patterns for writing entries to the Windows Event Log. It simplifies usage by handling:
 20''' </para>
 21''' <list type="bullet">
 22'''   <item>Automatic validation and creation of logs and sources.</item>
 23'''   <item>Falls back when <c>log</c> or <c>source</c> parameters are not provided.</item>
 24'''   <item>Automatic source naming based on the calling method and class context.</item>
 25'''   <item>Safe handling and truncation of long messages to comply with system limits.</item>
 26''' </list>
 27''' <para>
 28''' The default event log is <c>Application</c>. If no source is provided, a fully qualified method name
 29''' (including namespace and class) is used as the source identifier.
 30''' </para>
 31''' <para>
 32''' This module is suitable for both production use (via <see cref="RealEventLogWriter" />) and unit testing
 33''' (via a test implementation such as <c>EventLogHelper.Tests.TestEventLogWriter</c> in a separate test project).
 34''' </para>
 35''' </remarks>
 36Public Module SmartEventLogger
 37
 38#Region " Process Support Objects ^^^^^^^^^^^^^^^^^^^^^^^^^ "
 39
 40    ''' <summary>
 41    ''' The current event log writer instance used by the logger.
 42    ''' </summary>
 43    ''' <remarks>
 44    ''' By default, this is initialized to an instance of <see cref="RealEventLogWriter"/>, which writes to the actual
 45    ''' Windows Event Log. This field is typically replaced during testing with a mock or stub implementation via the
 46    ''' <see cref="SetWriter"/> method.
 47    ''' </remarks>
 848    Private _writer As IEventLogWriter = New RealEventLogWriter()
 49    ''' <summary>
 50    ''' The registry reader
 51    ''' </summary>
 852    Private _registryReader As IRegistryReader = New RealRegistryReader()
 53
 54    ''' <summary>
 55    ''' Sets the <see cref="IEventLogWriter"/> implementation used for logging operations.
 56    ''' </summary>
 57    ''' <param name="writer">
 58    ''' The custom writer instance to use. This allows swapping out the default <see cref="RealEventLogWriter"/>
 59    ''' for testing or alternate logging implementations.
 60    ''' </param>
 61    ''' <remarks>
 62    ''' This method is primarily intended for use in unit tests or advanced scenarios where log output should be redirec
 63    ''' or suppressed. For example, a test implementation may capture and inspect log data without writing to the real e
 64    ''' </remarks>
 23665    Public Sub SetWriter(writer As IEventLogWriter)
 66
 47267        _writer = writer
 68
 47269    End Sub
 70
 71    ''' <summary>
 72    ''' Specifies the <see cref="IRegistryReader"/> implementation to use when accessing
 73    ''' the Windows Registry for log-related operations (e.g., determining default event log sources).
 74    ''' </summary>
 75    ''' <param name="reader">
 76    ''' The custom <see cref="IRegistryReader"/> instance to use. This is typically used for unit testing
 77    ''' or customizing how registry access is performed. If not set, the default implementation will be used.
 78    ''' </param>
 79    ''' <remarks>
 80    ''' This method allows injection of a mock or testable registry reader. In production,
 81    ''' a default <c>RealRegistryReader</c> is used, but in unit tests, you may inject a fake
 82    ''' reader to simulate different registry states without accessing the actual system registry.
 83    ''' </remarks>
 4884    Public Sub SetRegistryReader(reader As IRegistryReader)
 85
 9686        _registryReader = reader
 87
 9688    End Sub
 89
 90#End Region
 91
 92#Region " Initialization ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 93
 94    ''' <summary>
 95    ''' Has the Initialization process happened?
 96    ''' This is used to prevent multiple initializations.
 97    ''' </summary>
 98    Private _isInitialized As Boolean
 99
 100    ''' <summary>
 101    ''' is initializing
 102    ''' </summary>
 103    Private _isInitializing As Boolean
 104
 105    ''' <summary>
 106    ''' The initialization lock
 107    ''' </summary>
 8108    Private ReadOnly _initLock As New Object()
 109
 110    ''' <summary>
 111    ''' Initializes this instance.
 112    ''' </summary>
 10340113    Private Sub Initialize()
 114
 30768115        If _isInitialized OrElse _isInitializing Then Return
 504116        _isInitializing = True
 756117        SyncLock _initLock
 252118            Try
 504119                If Not _isInitialized Then
 504120                    MachineName = GetAppSetting("EventLogHelper.MachineName", MachineName)
 504121                    LogName = GetAppSetting("EventLogHelper.LogName", LogName)
 504122                    SourceName = GetAppSetting("EventLogHelper.SourceName", SourceName)
 504123                    MaxKilobytes = GetAppSetting("EventLogHelper.MaxKilobytes", MaxKilobytes)
 504124                    RetentionDays = GetAppSetting("EventLogHelper.RetentionDays", RetentionDays)
 504125                    WriteInitEntry = GetAppSetting("EventLogHelper.WriteInitEntry", WriteInitEntry)
 504126                    TruncationMarker = GetAppSetting("EventLogHelper.TruncationMarker", TruncationMarker)
 504127                    ContinuationMarker = GetAppSetting("EventLogHelper.ContinuationMarker", ContinuationMarker)
 504128                    AllowMultiEntryMessages = GetAppSetting("EventLogHelper.AllowMultiEntryMessages", AllowMultiEntryMes
 504129                    IncludeSourceInMessage = GetAppSetting("EventLogHelper.IncludeSourceInMessage", IncludeSourceInMessa
 504130                    CurrentLoggingLevel = GetAppSetting("EventLogHelper.CurrentLoggingLevel", CurrentLoggingLevel)
 504131                    LoggingSeverity = GetAppSetting("EventLogHelper.LoggingSeverity", LoggingSeverity)
 504132                    SourceResolutionBehavior = GetAppSetting("EventLogHelper.SourceResolutionBehavior", SourceResolution
 133
 504134                    _isInitialized = True
 756135                End If
 252136            Finally
 504137                _isInitializing = False
 252138            End Try
 756139        End SyncLock
 140
 20680141    End Sub
 142
 143    ''' <summary>
 144    ''' Reads configuration values from <c>App.config</c>, <c>Web.config</c>, or
 145    ''' <c>appsettings.json</c> (depending on the target framework) and applies
 146    ''' them to <see cref="SmartEventLogger"/> defaults.
 147    ''' </summary>
 148    ''' <remarks>
 149    ''' <para>
 150    ''' This method reads predefined settings from the application's configuration and
 151    ''' applies them to the corresponding <see cref="SmartEventLogger"/> properties.
 152    ''' If a configuration value is not found, the property's existing value is retained.
 153    ''' </para>
 154    ''' <para>
 155    ''' Calling this method explicitly is optional. Configuration will also be loaded
 156    ''' automatically the first time a public method or property is accessed, unless it
 157    ''' has already been initialized.
 158    ''' </para>
 159    ''' <para>
 160    ''' Thread-safe: Initialization is guaranteed to run only once, even if called
 161    ''' concurrently from multiple threads.
 162    ''' </para>
 163    '''
 164    ''' <para>
 165    ''' Recognized configuration keys:
 166    ''' </para>
 167    ''' <list type="table">
 168    '''   <listheader>
 169    '''     <term>Key</term>
 170    '''     <description>Description</description>
 171    '''   </listheader>
 172    '''
 173    '''   <item>
 174    '''     <term>EventLogHelper.MachineName</term>
 175    '''     <description>
 176    ''' The name of the machine where the event log resides. Use <c>"."</c> for the local machine.
 177    ''' Defaults to the current value of <see cref="MachineName"/> (normally ".").
 178    ''' </description>
 179    '''   </item>
 180    '''
 181    '''   <item>
 182    '''     <term>EventLogHelper.LogName</term>
 183    '''     <description>
 184    ''' The name of the event log to write to (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log).
 185    ''' Defaults to the current value of <see cref="LogName"/> (normally "Application").
 186    ''' </description>
 187    '''   </item>
 188    '''
 189    '''   <item>
 190    '''     <term>EventLogHelper.SourceName</term>
 191    '''     <description>
 192    ''' The event source name associated with log entries. If not provided, a name is automatically
 193    ''' generated from the calling method's namespace, class, and method name. Defaults to
 194    ''' the current value of <see cref="SourceName"/>.
 195    ''' </description>
 196    '''   </item>
 197    '''
 198    '''   <item>
 199    '''     <term>EventLogHelper.MaxKilobytes</term>
 200    '''     <description>
 201    ''' The maximum size of the event log in kilobytes when creating a new log.
 202    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 203    ''' Defaults to the current value of <see cref="MaxKilobytes"/> (normally 0).
 204    ''' </description>
 205    '''   </item>
 206    '''
 207    '''   <item>
 208    '''     <term>EventLogHelper.RetentionDays</term>
 209    '''     <description>
 210    ''' The number of days to retain event log entries when creating a new log.
 211    ''' If 0, events are retained indefinitely.
 212    ''' Defaults to the current value of <see cref="RetentionDays"/> (normally 0).
 213    ''' </description>
 214    '''   </item>
 215    '''
 216    '''   <item>
 217    '''     <term>EventLogHelper.WriteInitEntry</term>
 218    '''     <description>
 219    ''' Indicates whether to write an initialization entry to the log when a new log is created.
 220    ''' Defaults to the current value of <see cref="WriteInitEntry"/> (normally True).
 221    ''' </description>
 222    '''   </item>
 223    '''
 224    '''   <item>
 225    '''     <term>EventLogHelper.TruncationMarker</term>
 226    '''     <description>
 227    ''' The string appended to messages that are truncated due to exceeding the 32,766-character limit.
 228    ''' Defaults to the current value of <see cref="TruncationMarker"/> (normally "... [TRUNCATED]").
 229    ''' </description>
 230    '''   </item>
 231    '''
 232    '''   <item>
 233    '''     <term>EventLogHelper.ContinuationMarker</term>
 234    '''     <description>
 235    ''' The string appended to all but the last chunk of a message when multi-entry logging is enabled.
 236    ''' Defaults to the current value of <see cref="ContinuationMarker"/> (normally " ...").
 237    ''' </description>
 238    '''   </item>
 239    '''
 240    '''   <item>
 241    '''     <term>EventLogHelper.AllowMultiEntryMessages</term>
 242    '''     <description>
 243    ''' Indicates whether messages longer than 32,766 characters should be split into multiple
 244    ''' sequential entries instead of being truncated. Defaults to the current value of
 245    ''' <see cref="AllowMultiEntryMessages"/> (normally False).
 246    ''' </description>
 247    '''   </item>
 248    '''
 249    ''' </list>
 250    ''' </remarks>
 8251    Public Sub InitializeConfiguration()
 252
 16253        Initialize()
 254
 16255    End Sub
 256
 257    ''' <summary>
 258    ''' Resets this instance.
 259    ''' </summary>
 296260    Friend Sub Reset()
 261
 262        ' Reset all configuration settings to their default values
 592263        _machineName = "."
 592264        _logName = "Application"
 592265        _sourceName = ""
 592266        _maxKilobytes = 1024 * 1024
 592267        _retentionDays = 7
 592268        _writeInitEntry = False
 592269        _IncludeSourceInMessage = True
 592270        _truncationMarker = "... [TRUNCATED]"
 592271        _continuationMarker = " ..."
 592272        _allowMultiEntryMessages = False
 592273        _CurrentLoggingLevel = LoggingLevel.Verbose
 592274        _LoggingSeverity = LoggingSeverity.Info
 592275        _sourceResolutionBehavior = SourceResolutionBehavior.Strict
 592276        _writer = New RealEventLogWriter()
 592277        _registryReader = New RealRegistryReader()
 592278        FileSystem = New RealFileSystemShim()
 592279        Config = New RealConfigShim()
 592280        JsonSettingsFile = "appsettings.json"
 592281        _isInitialized = False
 592282        _isInitializing = False
 283
 592284    End Sub
 285
 286#End Region
 287
 288#Region " Backing Fields ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 289
 290    ''' <summary>
 291    ''' The machine name
 292    ''' </summary>
 8293    Private _machineName As String = "."
 294    ''' <summary>
 295    ''' The log name
 296    ''' </summary>
 8297    Private _logName As String = "Application"
 298    ''' <summary>
 299    ''' The source name
 300    ''' </summary>
 8301    Private _sourceName As String = ""
 302    ''' <summary>
 303    ''' The maximum kilobytes
 304    ''' </summary>
 8305    Private _maxKilobytes As Integer = 1024 * 1024
 306    ''' <summary>
 307    ''' The retention days
 308    ''' </summary>
 8309    Private _retentionDays As Integer = 7
 310    ''' <summary>
 311    ''' The write initialize entry
 312    ''' </summary>
 313    Private _writeInitEntry As Boolean
 314    ''' <summary>
 315    ''' The truncation marker
 316    ''' </summary>
 8317    Private _truncationMarker As String = "... [TRUNCATED]"
 318    ''' <summary>
 319    ''' The continuation marker
 320    ''' </summary>
 8321    Private _continuationMarker As String = " ..."
 322    ''' <summary>
 323    ''' The allow multi entry messages
 324    ''' </summary>
 325    Private _allowMultiEntryMessages As Boolean
 326    ''' <summary>
 327    ''' include the source in message
 328    ''' </summary>
 8329    Private _IncludeSourceInMessage As Boolean = True
 330    ''' <summary>
 331    ''' The current logging level
 332    ''' </summary>
 8333    Private _CurrentLoggingLevel As LoggingLevel = LoggingLevel.Verbose
 334    ''' <summary>
 335    ''' The logging severity
 336    ''' </summary>
 8337    Private _LoggingSeverity As LoggingSeverity = LoggingSeverity.Info
 338    ''' <summary>
 339    ''' the source resolution behavior.
 340    ''' </summary>
 8341    Private _sourceResolutionBehavior As SourceResolutionBehavior = SourceResolutionBehavior.Strict
 342
 343#End Region
 344
 345#Region " Default Value Properties ^^^^^^^^^^^^^^^^^^^^^^^^ "
 346
 347    ''' <summary>
 348    ''' Gets or sets the name of the machine where log entries will be written.
 349    ''' </summary>
 350    ''' <value>
 351    ''' A string representing the machine name. Use <c>"."</c> for the local machine.
 352    ''' </value>
 353    Public Property MachineName As String
 354
 652355        Get
 356
 1304357            Initialize()
 1304358            Return _machineName
 359
 1304360        End Get
 280361        Set
 362
 560363            Initialize()
 560364            _machineName = Value
 365
 560366        End Set
 367
 368    End Property
 369
 370    ''' <summary>
 371    ''' Gets or sets the name of the Windows Event Log to write to (e.g., "Application", "System").
 372    ''' </summary>
 373    ''' <value>
 374    ''' A string specifying the log name. Defaults to <c>"Application"</c>.
 375    ''' </value>
 376    Public Property LogName As String
 377
 436378        Get
 379
 872380            Initialize()
 872381            Return _logName
 382
 872383        End Get
 256384        Set
 385
 512386            Initialize()
 512387            _logName = Value
 388
 512389        End Set
 390
 391    End Property
 392
 393    ''' <summary>
 394    ''' Gets or sets the name of the event source associated with log entries.
 395    ''' </summary>
 396    ''' <value>
 397    ''' A string representing the source name. If not set, a source is inferred automatically using the calling method's
 398    ''' </value>
 399    Public Property SourceName As String
 400
 400401        Get
 402
 800403            Initialize()
 800404            Return _sourceName
 405
 800406        End Get
 268407        Set
 408
 536409            Initialize()
 536410            _sourceName = Value
 411
 536412        End Set
 413
 414    End Property
 415
 416    ''' <summary>
 417    ''' Gets or sets the maximum allowed size of the event log in kilobytes.
 418    ''' </summary>
 419    ''' <value>
 420    ''' An integer representing the size in kilobytes. Defaults to <c>1,048,576</c> (1 GB).
 421    ''' </value>
 422    ''' <remarks>
 423    ''' Applies only when creating or configuring new custom logs. May require administrative privileges.
 424    ''' </remarks>
 425    Public Property MaxKilobytes As Integer
 426
 472427        Get
 428
 944429            Initialize()
 944430            Return _maxKilobytes
 431
 944432        End Get
 256433        Set
 434
 512435            Initialize()
 512436            _maxKilobytes = Value
 437
 512438        End Set
 439
 440    End Property
 441
 442    ''' <summary>
 443    ''' Gets or sets the number of days event entries are retained before being overwritten.
 444    ''' </summary>
 445    ''' <value>
 446    ''' An integer representing the retention duration in days. Defaults to <c>7</c>.
 447    ''' </value>
 448    ''' <remarks>
 449    ''' Used when initializing a new event log. May be ignored depending on overflow policy or system restrictions.
 450    ''' </remarks>
 451    Public Property RetentionDays As Integer
 452
 476453        Get
 454
 952455            Initialize()
 952456            Return _retentionDays
 457
 952458        End Get
 256459        Set
 460
 512461            Initialize()
 512462            _retentionDays = Value
 463
 512464        End Set
 465
 466    End Property
 467
 468    ''' <summary>
 469    ''' Gets or sets a value indicating whether an informational entry should be written when a new log is created.
 470    ''' </summary>
 471    ''' <value>
 472    ''' <c>True</c> to log an initialization message; otherwise, <c>False</c>. Defaults to <c>False</c>.
 473    ''' </value>
 474    Public Property WriteInitEntry As Boolean
 475
 484476        Get
 477
 968478            Initialize()
 968479            Return _writeInitEntry
 480
 968481        End Get
 256482        Set
 483
 512484            Initialize()
 512485            _writeInitEntry = Value
 486
 512487        End Set
 488
 489    End Property
 490
 491    ''' <summary>
 492    ''' Gets or sets the marker text used when a message is too long and must be truncated.
 493    ''' </summary>
 494    ''' <value>
 495    ''' A string appended to truncated log entries. Defaults to <c>"... [TRUNCATED]"</c>.
 496    ''' </value>
 497    Public Property TruncationMarker As String
 498
 668499        Get
 500
 1336501            Initialize()
 1336502            Return _truncationMarker
 503
 1336504        End Get
 260505        Set
 506
 520507            Initialize()
 520508            _truncationMarker = Value
 509
 520510        End Set
 511
 512    End Property
 513
 514    ''' <summary>
 515    ''' Gets or sets the continuation marker used when splitting long messages
 516    ''' across multiple event log entries.
 517    ''' </summary>
 518    ''' <value>
 519    ''' The string appended to each intermediate log entry when
 520    ''' <see cref="AllowMultiEntryMessages"/> is <c>true</c>.
 521    ''' Defaults to <c>" ..."</c>.
 522    ''' This value is ignored if message splitting is disabled.
 523    ''' </value>
 524    ''' <remarks>
 525    ''' The marker is added to all chunks except the final one to indicate the
 526    ''' message continues in the next log entry. Make sure the marker is short
 527    ''' enough to allow meaningful message content within the 32,766-character
 528    ''' limit of the Event Log.
 529    ''' </remarks>
 530    Public Property ContinuationMarker As String
 531
 264532        Get
 533
 528534            Initialize()
 528535            Return _continuationMarker
 536
 528537        End Get
 264538        Set
 539
 528540            Initialize()
 528541            _continuationMarker = Value
 542
 528543        End Set
 544
 545    End Property
 546
 547    ''' <summary>
 548    ''' Gets or sets a value indicating whether messages that exceed the Event Log
 549    ''' length limit should be split across multiple entries.
 550    ''' </summary>
 551    ''' <value>
 552    ''' <c>true</c> to split long messages into multiple event log entries;
 553    ''' <c>false</c> to truncate long messages and append a truncation notice.
 554    ''' Default is <c>false</c>.
 555    ''' </value>
 556    ''' <remarks>
 557    ''' When enabled, messages exceeding 32,766 characters are split into sequential entries,
 558    ''' each prefixed with a part number and optionally suffixed with a continuation marker
 559    ''' (see <see cref="ContinuationMarker"/>). This preserves the full message without truncation.
 560    '''
 561    ''' When disabled, long messages are truncated to fit within the Event Log limit,
 562    ''' and the truncation marker (e.g., <c>"... [TRUNCATED]"</c>) is appended.
 563    ''' </remarks>
 564    Public Property AllowMultiEntryMessages As Boolean
 565
 476566        Get
 567
 952568            Initialize()
 952569            Return _allowMultiEntryMessages
 570
 952571        End Get
 324572        Set
 573
 648574            Initialize()
 648575            _allowMultiEntryMessages = Value
 576
 648577        End Set
 578
 579    End Property
 580
 581    ''' <summary>
 582    ''' Gets a value indicating whether this instance is initialized.
 583    ''' </summary>
 584    ''' <value>
 585    '''   <c>true</c> if this instance is initialized; otherwise, <c>false</c>.
 586    ''' </value>
 587    Public ReadOnly Property IsInitialized As Boolean
 588
 4589        Get
 8590            Return _isInitialized
 591
 8592        End Get
 593
 594    End Property
 595
 596    ''' <summary>
 597    ''' Gets or sets a value indicating whether to include the source in the message.
 598    ''' </summary>
 599    ''' <value>
 600    '''   <c>true</c> if the source should be included in the message; otherwise, <c>false</c>.
 601    ''' </value>
 602    Public Property IncludeSourceInMessage As Boolean
 276603        Get
 552604            Initialize()
 552605            Return _IncludeSourceInMessage
 552606        End Get
 260607        Set
 520608            Initialize()
 520609            _IncludeSourceInMessage = Value
 520610        End Set
 611    End Property
 612
 613    ''' <summary>
 614    ''' Gets or sets the minimum <see cref="LoggingLevel"/> that must be met
 615    ''' for log entries to be written.
 616    ''' </summary>
 617    ''' <value>
 618    ''' The currently active logging level. Entries with a severity below this level
 619    ''' will be ignored. Defaults to <see cref="LoggingLevel.Normal"/>.
 620    ''' </value>
 621    ''' <remarks>
 622    ''' This property acts as a global filter to increase or decrease the verbosity
 623    ''' of logging at runtime. For example, setting this to
 624    ''' <see cref="LoggingLevel.Verbose"/> allows all entries to be logged, while
 625    ''' <see cref="LoggingLevel.Minimal"/> ensures only warnings, errors, and critical
 626    ''' entries are written.
 627    ''' </remarks>
 628    Public Property CurrentLoggingLevel As LoggingLevel
 629
 524630        Get
 631
 1048632            Initialize()
 1048633            Return _CurrentLoggingLevel
 634
 1048635        End Get
 332636        Set
 637
 664638            Initialize()
 664639            _CurrentLoggingLevel = Value
 640
 664641        End Set
 642
 643    End Property
 644
 645    ''' <summary>
 646    ''' Gets or sets the default <see cref="LoggingSeverity"/> applied to log entries
 647    ''' when no explicit severity is specified.
 648    ''' </summary>
 649    ''' <value>
 650    ''' The default severity level for new log entries. Defaults to
 651    ''' <see cref="LoggingSeverity.Info"/>.
 652    ''' </value>
 653    ''' <remarks>
 654    ''' This property determines the baseline importance assigned to entries that do
 655    ''' not specify a severity. For example, a call such as
 656    ''' <c>SmartEventLogger.Log("Started service.")</c> will use this value.
 657    ''' Combined with <see cref="CurrentLoggingLevel"/>, it controls whether the
 658    ''' entry is written or ignored.
 659    ''' </remarks>
 660    Public Property LoggingSeverity As LoggingSeverity
 661
 352662        Get
 663
 704664            Initialize()
 704665            Return _LoggingSeverity
 666
 704667        End Get
 252668        Set
 669
 504670            Initialize()
 504671            _LoggingSeverity = Value
 672
 504673        End Set
 674
 675    End Property
 676
 677    ''' <summary>
 678    ''' Gets or sets the strategy used when resolving event sources that are
 679    ''' registered under a different log than the one requested.
 680    ''' </summary>
 681    ''' <value>
 682    ''' A <see cref="SourceResolutionBehavior"/> value that determines whether logging
 683    ''' requires an exact source-to-log match (<c>Strict</c>), automatically switches
 684    ''' to the log where the source is registered (<c>UseSourceLog</c>), or creates a
 685    ''' new source under the requested log (<c>CreateNewSource</c>).
 686    ''' </value>
 687    ''' <remarks>
 688    ''' This setting controls how <see cref="SmartEventLogger"/> handles cases where
 689    ''' the requested source and log are not aligned, which can occur on
 690    ''' misconfigured systems or when reusing existing event sources.
 691    ''' </remarks>
 692    Public Property SourceResolutionBehavior As SourceResolutionBehavior
 693
 252694        Get
 695
 504696            Initialize()
 504697            Return _sourceResolutionBehavior
 698
 504699        End Get
 260700        Set
 701
 520702            Initialize()
 520703            _sourceResolutionBehavior = Value
 704
 520705        End Set
 706
 707    End Property
 708
 709    ''' <summary>
 710    ''' Gets or sets the file system.
 711    ''' </summary>
 712    ''' <value>
 713    ''' The file system.
 714    ''' </value>
 8715    Friend Property FileSystem As IFileSystemShim = New RealFileSystemShim()
 716
 717    ''' <summary>
 718    ''' Gets or sets the configuration.
 719    ''' </summary>
 720    ''' <value>
 721    ''' The configuration.
 722    ''' </value>
 8723    Friend Property Config As IConfigShim = New RealConfigShim()
 724
 725    ''' <summary>
 726    ''' Gets or sets the JSON settings file name to check for configuration.
 727    ''' Defaults to "appsettings.json".
 728    ''' </summary>
 8729    Friend Property JsonSettingsFile As String = "appsettings.json"
 730
 731#End Region
 732
 733#Region " Log Methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 734
 735    ''' <summary>
 736    ''' Writes an entry to the Windows Event Log using the provided parameters.
 737    ''' </summary>
 738    ''' <param name="message">
 739    ''' The message to log. If <c>null</c> or empty, a default message is used.
 740    '''
 741    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 742    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 743    '''
 744    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 745    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 746    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 747    ''' </param>
 748    ''' <remarks>
 749    ''' <para>
 750    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 751    ''' </para>
 752    ''' <para>
 753    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 754    ''' </para>
 755    ''' </remarks>
 8756    Public Sub Log(
 8757            ByVal message As String)
 758
 16759        Log("",
 16760            "",
 16761            message)
 762
 16763    End Sub
 764
 765    ''' <summary>
 766    ''' Writes an entry to the Windows Event Log using the provided parameters.
 767    ''' </summary>
 768    ''' <param name="message">
 769    ''' The message to log. If <c>null</c> or empty, a default message is used.
 770    '''
 771    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 772    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 773    '''
 774    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 775    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 776    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 777    ''' </param>
 778    ''' <param name="EntrySeverity">
 779    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 780    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 781    ''' will be skipped and not written to the Event Log.
 782    ''' </param>
 783    ''' <remarks>
 784    ''' <para>
 785    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 786    ''' </para>
 787    ''' <para>
 788    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 789    ''' </para>
 790    ''' </remarks>
 20791    Public Sub Log(
 20792            ByVal message As String,
 20793            ByVal EntrySeverity As LoggingSeverity)
 794
 40795        Log("",
 40796            "",
 40797            message,
 40798            EntrySeverity)
 799
 40800    End Sub
 801
 802    ''' <summary>
 803    ''' Writes an entry to the Windows Event Log using the provided parameters.
 804    ''' </summary>
 805    ''' <param name="source">
 806    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 807    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 808    ''' </param>
 809    ''' <param name="message">
 810    ''' The message to log. If <c>null</c> or empty, a default message is used.
 811    '''
 812    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 813    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 814    '''
 815    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 816    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 817    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 818    ''' </param>
 819    ''' <remarks>
 820    ''' <para>
 821    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 822    ''' </para>
 823    ''' <para>
 824    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 825    ''' </para>
 826    ''' </remarks>
 4827    Public Sub Log(
 4828            ByVal source As String,
 4829            ByVal message As String)
 830
 8831        Log("",
 8832            source,
 8833            message)
 834
 8835    End Sub
 836
 837    ''' <summary>
 838    ''' Writes an entry to the Windows Event Log using the provided parameters.
 839    ''' </summary>
 840    ''' <param name="source">
 841    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 842    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 843    ''' </param>
 844    ''' <param name="message">
 845    ''' The message to log. If <c>null</c> or empty, a default message is used.
 846    '''
 847    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 848    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 849    '''
 850    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 851    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 852    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 853    ''' </param>
 854    ''' <param name="EntrySeverity">
 855    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 856    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 857    ''' will be skipped and not written to the Event Log.
 858    ''' </param>
 859    ''' <remarks>
 860    ''' <para>
 861    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 862    ''' </para>
 863    ''' <para>
 864    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 865    ''' </para>
 866    ''' </remarks>
 4867    Public Sub Log(
 4868            ByVal source As String,
 4869            ByVal message As String,
 4870            ByVal EntrySeverity As LoggingSeverity)
 871
 8872        Log("",
 8873            source,
 8874            message,
 8875            EntrySeverity)
 876
 8877    End Sub
 878
 879    ''' <summary>
 880    ''' Writes an entry to the Windows Event Log using the provided parameters.
 881    ''' </summary>
 882    ''' <param name="message">
 883    ''' The message to log. If <c>null</c> or empty, a default message is used.
 884    '''
 885    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 886    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 887    '''
 888    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 889    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 890    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 891    ''' </param>
 892    ''' <param name="eventType">
 893    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 894    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 895    ''' </param>
 896    ''' <remarks>
 897    ''' <para>
 898    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 899    ''' </para>
 900    ''' <para>
 901    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 902    ''' </para>
 903    ''' </remarks>
 4904    Public Sub Log(
 4905            ByVal message As String,
 4906            ByVal eventType As EventLogEntryType)
 907
 8908        Log("",
 8909            message,
 8910            eventType)
 911
 8912    End Sub
 913
 914    ''' <summary>
 915    ''' Writes an entry to the Windows Event Log using the provided parameters.
 916    ''' </summary>
 917    ''' <param name="message">
 918    ''' The message to log. If <c>null</c> or empty, a default message is used.
 919    '''
 920    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 921    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 922    '''
 923    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 924    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 925    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 926    ''' </param>
 927    ''' <param name="eventType">
 928    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 929    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 930    ''' </param>
 931    ''' <param name="EntrySeverity">
 932    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 933    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 934    ''' will be skipped and not written to the Event Log.
 935    ''' </param>
 936    ''' <remarks>
 937    ''' <para>
 938    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 939    ''' </para>
 940    ''' <para>
 941    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 942    ''' </para>
 943    ''' </remarks>
 4944    Public Sub Log(
 4945            ByVal message As String,
 4946            ByVal eventType As EventLogEntryType,
 4947            ByVal EntrySeverity As LoggingSeverity)
 948
 8949        Log("",
 8950            message,
 8951            eventType,
 8952            EntrySeverity)
 953
 8954    End Sub
 955
 956    ''' <summary>
 957    ''' Writes an entry to the Windows Event Log using the provided parameters.
 958    ''' </summary>
 959    ''' <param name="logName">
 960    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 961    ''' If <c>null</c> or empty, "Application" is used by default.
 962    ''' </param>
 963    ''' <param name="sourceName">
 964    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 965    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 966    ''' </param>
 967    ''' <param name="message">
 968    ''' The message to log. If <c>null</c> or empty, a default message is used.
 969    '''
 970    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 971    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 972    '''
 973    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 974    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 975    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 976    ''' </param>
 977    ''' <remarks>
 978    ''' <para>
 979    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 980    ''' </para>
 981    ''' <para>
 982    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 983    ''' </para>
 984    ''' </remarks>
 16985    Public Sub Log(
 16986            ByVal logName As String,
 16987            ByVal sourceName As String,
 16988            ByVal message As String)
 989
 32990        Log(logName,
 32991            sourceName,
 32992            message,
 32993            EventLogEntryType.Information)
 994
 32995    End Sub
 996
 997    ''' <summary>
 998    ''' Writes an entry to the Windows Event Log using the provided parameters.
 999    ''' </summary>
 1000    ''' <param name="logName">
 1001    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1002    ''' If <c>null</c> or empty, "Application" is used by default.
 1003    ''' </param>
 1004    ''' <param name="sourceName">
 1005    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1006    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1007    ''' </param>
 1008    ''' <param name="message">
 1009    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1010    '''
 1011    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1012    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1013    '''
 1014    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1015    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1016    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1017    ''' </param>
 1018    ''' <param name="EntrySeverity">
 1019    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1020    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1021    ''' will be skipped and not written to the Event Log.
 1022    ''' </param>
 1023    ''' <remarks>
 1024    ''' <para>
 1025    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1026    ''' </para>
 1027    ''' <para>
 1028    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1029    ''' </para>
 1030    ''' </remarks>
 241031    Public Sub Log(
 241032            ByVal logName As String,
 241033            ByVal sourceName As String,
 241034            ByVal message As String,
 241035            ByVal EntrySeverity As LoggingSeverity)
 1036
 481037        Log(logName,
 481038            sourceName,
 481039            message,
 481040            EventLogEntryType.Information,
 481041            EntrySeverity)
 1042
 481043    End Sub
 1044
 1045    ''' <summary>
 1046    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1047    ''' </summary>
 1048    ''' <param name="sourceName">
 1049    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1050    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1051    ''' </param>
 1052    ''' <param name="message">
 1053    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1054    '''
 1055    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1056    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1057    '''
 1058    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1059    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1060    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1061    ''' </param>
 1062    ''' <param name="eventType">
 1063    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1064    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1065    ''' </param>
 1066    ''' <remarks>
 1067    ''' <para>
 1068    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1069    ''' </para>
 1070    ''' <para>
 1071    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1072    ''' </para>
 1073    ''' </remarks>
 81074    Public Sub Log(
 81075            ByVal sourceName As String,
 81076            ByVal message As String,
 81077            ByVal eventType As EventLogEntryType)
 1078
 161079        Log("",
 161080            sourceName,
 161081            message,
 161082            eventType)
 1083
 161084    End Sub
 1085
 1086    ''' <summary>
 1087    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1088    ''' </summary>
 1089    ''' <param name="sourceName">
 1090    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1091    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1092    ''' </param>
 1093    ''' <param name="message">
 1094    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1095    '''
 1096    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1097    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1098    '''
 1099    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1100    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1101    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1102    ''' </param>
 1103    ''' <param name="eventType">
 1104    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1105    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1106    ''' </param>
 1107    ''' <param name="EntrySeverity">
 1108    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1109    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1110    ''' will be skipped and not written to the Event Log.
 1111    ''' </param>
 1112    ''' <remarks>
 1113    ''' <para>
 1114    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1115    ''' </para>
 1116    ''' <para>
 1117    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1118    ''' </para>
 1119    ''' </remarks>
 41120    Public Sub Log(
 41121            ByVal sourceName As String,
 41122            ByVal message As String,
 41123            ByVal eventType As EventLogEntryType,
 41124            ByVal EntrySeverity As LoggingSeverity)
 1125
 81126        Log("",
 81127            sourceName,
 81128            message,
 81129            eventType,
 81130            EntrySeverity)
 1131
 81132    End Sub
 1133
 1134    ''' <summary>
 1135    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1136    ''' </summary>
 1137    ''' <param name="logName">
 1138    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1139    ''' If <c>null</c> or empty, "Application" is used by default.
 1140    ''' </param>
 1141    ''' <param name="sourceName">
 1142    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1143    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1144    ''' </param>
 1145    ''' <param name="message">
 1146    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1147    '''
 1148    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1149    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1150    '''
 1151    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1152    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1153    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1154    ''' </param>
 1155    ''' <param name="eventType">
 1156    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1157    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1158    ''' </param>
 1159    ''' <remarks>
 1160    ''' <para>
 1161    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1162    ''' </para>
 1163    ''' <para>
 1164    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1165    ''' </para>
 1166    ''' </remarks>
 281167    Public Sub Log(
 281168            ByVal logName As String,
 281169            ByVal sourceName As String,
 281170            ByVal message As String,
 281171            ByVal eventType As EventLogEntryType)
 1172
 561173        Log(logName,
 561174            sourceName,
 561175            message,
 561176            eventType,
 561177            0)
 1178
 561179    End Sub
 1180
 1181    ''' <summary>
 1182    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1183    ''' </summary>
 1184    ''' <param name="logName">
 1185    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1186    ''' If <c>null</c> or empty, "Application" is used by default.
 1187    ''' </param>
 1188    ''' <param name="sourceName">
 1189    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1190    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1191    ''' </param>
 1192    ''' <param name="message">
 1193    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1194    '''
 1195    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1196    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1197    '''
 1198    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1199    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1200    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1201    ''' </param>
 1202    ''' <param name="eventType">
 1203    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1204    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1205    ''' </param>
 1206    ''' <param name="EntrySeverity">
 1207    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1208    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1209    ''' will be skipped and not written to the Event Log.
 1210    ''' </param>
 1211    ''' <remarks>
 1212    ''' <para>
 1213    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1214    ''' </para>
 1215    ''' <para>
 1216    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1217    ''' </para>
 1218    ''' </remarks>
 281219    Public Sub Log(
 281220            ByVal logName As String,
 281221            ByVal sourceName As String,
 281222            ByVal message As String,
 281223            ByVal eventType As EventLogEntryType,
 281224            ByVal EntrySeverity As LoggingSeverity)
 1225
 561226        Log(logName,
 561227            sourceName,
 561228            message,
 561229            eventType,
 561230            0,
 561231            EntrySeverity)
 1232
 561233    End Sub
 1234
 1235    ''' <summary>
 1236    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1237    ''' </summary>
 1238    ''' <param name="message">
 1239    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1240    '''
 1241    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1242    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1243    '''
 1244    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1245    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1246    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1247    ''' </param>
 1248    ''' <param name="eventType">
 1249    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1250    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1251    ''' </param>
 1252    ''' <param name="eventID">
 1253    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1254    ''' </param>
 1255    ''' <remarks>
 1256    ''' <para>
 1257    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1258    ''' </para>
 1259    ''' <para>
 1260    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1261    ''' </para>
 1262    ''' </remarks>
 41263    Public Sub Log(
 41264            ByVal message As String,
 41265            ByVal eventType As EventLogEntryType,
 41266            ByVal eventID As Integer)
 1267
 81268        Log("",
 81269            message,
 81270            eventType,
 81271            eventID)
 1272
 81273    End Sub
 1274
 1275    ''' <summary>
 1276    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1277    ''' </summary>
 1278    ''' <param name="message">
 1279    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1280    '''
 1281    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1282    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1283    '''
 1284    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1285    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1286    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1287    ''' </param>
 1288    ''' <param name="eventType">
 1289    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1290    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1291    ''' </param>
 1292    ''' <param name="eventID">
 1293    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1294    ''' </param>
 1295    ''' <param name="EntrySeverity">
 1296    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1297    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1298    ''' will be skipped and not written to the Event Log.
 1299    ''' </param>
 1300    ''' <remarks>
 1301    ''' <para>
 1302    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1303    ''' </para>
 1304    ''' <para>
 1305    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1306    ''' </para>
 1307    ''' </remarks>
 41308    Public Sub Log(
 41309            ByVal message As String,
 41310            ByVal eventType As EventLogEntryType,
 41311            ByVal eventID As Integer,
 41312            ByVal EntrySeverity As LoggingSeverity)
 1313
 81314        Log("",
 81315            message,
 81316            eventType,
 81317            eventID,
 81318            EntrySeverity)
 1319
 81320    End Sub
 1321
 1322    ''' <summary>
 1323    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1324    ''' </summary>
 1325    ''' <param name="sourceName">
 1326    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1327    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1328    ''' </param>
 1329    ''' <param name="message">
 1330    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1331    '''
 1332    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1333    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1334    '''
 1335    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1336    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1337    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1338    ''' </param>
 1339    ''' <param name="eventType">
 1340    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1341    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1342    ''' </param>
 1343    ''' <param name="eventID">
 1344    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1345    ''' </param>
 1346    ''' <remarks>
 1347    ''' <para>
 1348    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1349    ''' </para>
 1350    ''' <para>
 1351    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1352    ''' </para>
 1353    ''' </remarks>
 41354    Public Sub Log(
 41355            ByVal sourceName As String,
 41356            ByVal message As String,
 41357            ByVal eventType As EventLogEntryType,
 41358            ByVal eventID As Integer)
 1359
 81360        Log("",
 81361            sourceName,
 81362            message,
 81363            eventType,
 81364            eventID)
 1365
 81366    End Sub
 1367
 1368    ''' <summary>
 1369    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1370    ''' </summary>
 1371    ''' <param name="sourceName">
 1372    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1373    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1374    ''' </param>
 1375    ''' <param name="message">
 1376    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1377    '''
 1378    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1379    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1380    '''
 1381    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1382    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1383    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1384    ''' </param>
 1385    ''' <param name="eventType">
 1386    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1387    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1388    ''' </param>
 1389    ''' <param name="eventID">
 1390    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1391    ''' </param>
 1392    ''' <param name="EntrySeverity">
 1393    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1394    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1395    ''' will be skipped and not written to the Event Log.
 1396    ''' </param>
 1397    ''' <remarks>
 1398    ''' <para>
 1399    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1400    ''' </para>
 1401    ''' <para>
 1402    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1403    ''' </para>
 1404    ''' </remarks>
 41405    Public Sub Log(
 41406            ByVal sourceName As String,
 41407            ByVal message As String,
 41408            ByVal eventType As EventLogEntryType,
 41409            ByVal eventID As Integer,
 41410            ByVal EntrySeverity As LoggingSeverity)
 1411
 81412        Log("",
 81413            sourceName,
 81414            message,
 81415            eventType,
 81416            eventID,
 81417            EntrySeverity)
 1418
 81419    End Sub
 1420
 1421    ''' <summary>
 1422    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1423    ''' </summary>
 1424    ''' <param name="logName">
 1425    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1426    ''' If <c>null</c> or empty, "Application" is used by default.
 1427    ''' </param>
 1428    ''' <param name="sourceName">
 1429    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1430    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1431    ''' </param>
 1432    ''' <param name="message">
 1433    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1434    '''
 1435    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1436    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1437    '''
 1438    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1439    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1440    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1441    ''' </param>
 1442    ''' <param name="eventType">
 1443    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1444    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1445    ''' </param>
 1446    ''' <param name="eventID">
 1447    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1448    ''' </param>
 1449    ''' <remarks>
 1450    ''' <para>
 1451    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1452    ''' </para>
 1453    ''' <para>
 1454    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1455    ''' </para>
 1456    ''' </remarks>
 361457    Public Sub Log(
 361458            ByVal logName As String,
 361459            ByVal sourceName As String,
 361460            ByVal message As String,
 361461            ByVal eventType As EventLogEntryType,
 361462            ByVal eventID As Integer)
 1463
 721464        Log(logName,
 721465            sourceName,
 721466            message,
 721467            eventType,
 721468            eventID,
 721469            0)
 1470
 721471    End Sub
 1472
 1473    ''' <summary>
 1474    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1475    ''' </summary>
 1476    ''' <param name="logName">
 1477    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1478    ''' If <c>null</c> or empty, "Application" is used by default.
 1479    ''' </param>
 1480    ''' <param name="sourceName">
 1481    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1482    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1483    ''' </param>
 1484    ''' <param name="message">
 1485    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1486    '''
 1487    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1488    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1489    '''
 1490    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1491    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1492    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1493    ''' </param>
 1494    ''' <param name="eventType">
 1495    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1496    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1497    ''' </param>
 1498    ''' <param name="eventID">
 1499    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1500    ''' </param>
 1501    ''' <param name="EntrySeverity">
 1502    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1503    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1504    ''' will be skipped and not written to the Event Log.
 1505    ''' </param>
 1506    ''' <remarks>
 1507    ''' <para>
 1508    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1509    ''' </para>
 1510    ''' <para>
 1511    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1512    ''' </para>
 1513    ''' </remarks>
 681514    Public Sub Log(
 681515            ByVal logName As String,
 681516            ByVal sourceName As String,
 681517            ByVal message As String,
 681518            ByVal eventType As EventLogEntryType,
 681519            ByVal eventID As Integer,
 681520            ByVal EntrySeverity As LoggingSeverity)
 1521
 1361522        Log(logName,
 1361523            sourceName,
 1361524            message,
 1361525            eventType,
 1361526            eventID,
 1361527            0,
 1361528            EntrySeverity)
 1529
 1361530    End Sub
 1531
 1532    ''' <summary>
 1533    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1534    ''' </summary>
 1535    ''' <param name="message">
 1536    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1537    '''
 1538    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1539    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1540    '''
 1541    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1542    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1543    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1544    ''' </param>
 1545    ''' <param name="eventType">
 1546    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1547    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1548    ''' </param>
 1549    ''' <param name="eventID">
 1550    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1551    ''' </param>
 1552    ''' <param name="category">
 1553    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1554    ''' </param>
 1555    ''' <remarks>
 1556    ''' <para>
 1557    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1558    ''' </para>
 1559    ''' <para>
 1560    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1561    ''' </para>
 1562    ''' </remarks>
 41563    Public Sub Log(
 41564            ByVal message As String,
 41565            ByVal eventType As EventLogEntryType,
 41566            ByVal eventID As Integer,
 41567            ByVal category As Short)
 1568
 81569        Log("",
 81570            message,
 81571            eventType,
 81572            eventID,
 81573            category)
 1574
 81575    End Sub
 1576
 1577    ''' <summary>
 1578    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1579    ''' </summary>
 1580    ''' <param name="message">
 1581    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1582    '''
 1583    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1584    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1585    '''
 1586    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1587    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1588    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1589    ''' </param>
 1590    ''' <param name="eventType">
 1591    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1592    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1593    ''' </param>
 1594    ''' <param name="eventID">
 1595    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1596    ''' </param>
 1597    ''' <param name="category">
 1598    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1599    ''' </param>
 1600    ''' <param name="EntrySeverity">
 1601    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1602    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1603    ''' will be skipped and not written to the Event Log.
 1604    ''' </param>
 1605    ''' <remarks>
 1606    ''' <para>
 1607    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1608    ''' </para>
 1609    ''' <para>
 1610    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1611    ''' </para>
 1612    ''' </remarks>
 41613    Public Sub Log(
 41614            ByVal message As String,
 41615            ByVal eventType As EventLogEntryType,
 41616            ByVal eventID As Integer,
 41617            ByVal category As Short,
 41618            ByVal EntrySeverity As LoggingSeverity)
 1619
 81620        Log("",
 81621            message,
 81622            eventType,
 81623            eventID,
 81624            category,
 81625            EntrySeverity)
 1626
 81627    End Sub
 1628
 1629    ''' <summary>
 1630    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1631    ''' </summary>
 1632    ''' <param name="sourceName">
 1633    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1634    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1635    ''' </param>
 1636    ''' <param name="message">
 1637    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1638    '''
 1639    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1640    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1641    '''
 1642    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1643    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1644    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1645    ''' </param>
 1646    ''' <param name="eventType">
 1647    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1648    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1649    ''' </param>
 1650    ''' <param name="eventID">
 1651    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1652    ''' </param>
 1653    ''' <param name="category">
 1654    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1655    ''' </param>
 1656    ''' <remarks>
 1657    ''' <para>
 1658    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1659    ''' </para>
 1660    ''' <para>
 1661    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1662    ''' </para>
 1663    ''' </remarks>
 81664    Public Sub Log(
 81665            ByVal sourceName As String,
 81666            ByVal message As String,
 81667            ByVal eventType As EventLogEntryType,
 81668            ByVal eventID As Integer,
 81669            ByVal category As Short)
 1670
 161671        Log("",
 161672            sourceName,
 161673            message,
 161674            eventType,
 161675            eventID,
 161676            category)
 1677
 161678    End Sub
 1679
 1680    ''' <summary>
 1681    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1682    ''' </summary>
 1683    ''' <param name="sourceName">
 1684    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1685    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1686    ''' </param>
 1687    ''' <param name="message">
 1688    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1689    '''
 1690    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1691    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1692    '''
 1693    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1694    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1695    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1696    ''' </param>
 1697    ''' <param name="eventType">
 1698    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1699    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1700    ''' </param>
 1701    ''' <param name="eventID">
 1702    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1703    ''' </param>
 1704    ''' <param name="category">
 1705    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1706    ''' </param>
 1707    ''' <param name="EntrySeverity">
 1708    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1709    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1710    ''' will be skipped and not written to the Event Log.
 1711    ''' </param>
 1712    ''' <remarks>
 1713    ''' <para>
 1714    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1715    ''' </para>
 1716    ''' <para>
 1717    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1718    ''' </para>
 1719    ''' </remarks>
 41720    Public Sub Log(
 41721            ByVal sourceName As String,
 41722            ByVal message As String,
 41723            ByVal eventType As EventLogEntryType,
 41724            ByVal eventID As Integer,
 41725            ByVal category As Short,
 41726            ByVal EntrySeverity As LoggingSeverity)
 1727
 81728        Log("",
 81729            sourceName,
 81730            message,
 81731            eventType,
 81732            eventID,
 81733            category,
 81734            EntrySeverity)
 1735
 81736    End Sub
 1737
 1738    ''' <summary>
 1739    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1740    ''' </summary>
 1741    ''' <param name="logName">
 1742    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1743    ''' If <c>null</c> or empty, "Application" is used by default.
 1744    ''' </param>
 1745    ''' <param name="sourceName">
 1746    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1747    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1748    ''' </param>
 1749    ''' <param name="message">
 1750    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1751    '''
 1752    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1753    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1754    '''
 1755    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1756    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1757    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1758    ''' </param>
 1759    ''' <param name="eventType">
 1760    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1761    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1762    ''' </param>
 1763    ''' <param name="eventID">
 1764    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1765    ''' </param>
 1766    ''' <param name="category">
 1767    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1768    ''' </param>
 1769    ''' <remarks>
 1770    ''' <para>
 1771    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1772    ''' </para>
 1773    ''' <para>
 1774    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1775    ''' </para>
 1776    ''' </remarks>
 121777    Public Sub Log(
 121778            ByVal logName As String,
 121779            ByVal sourceName As String,
 121780            ByVal message As String,
 121781            ByVal eventType As EventLogEntryType,
 121782            ByVal eventID As Integer,
 121783            ByVal category As Short)
 1784
 241785        Log("",
 241786            logName,
 241787            sourceName,
 241788            message,
 241789            eventType,
 241790            eventID,
 241791            category,
 241792            Nothing)
 1793
 241794    End Sub
 1795
 1796    ''' <summary>
 1797    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1798    ''' </summary>
 1799    ''' <param name="logName">
 1800    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 1801    ''' If <c>null</c> or empty, "Application" is used by default.
 1802    ''' </param>
 1803    ''' <param name="sourceName">
 1804    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 1805    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 1806    ''' </param>
 1807    ''' <param name="message">
 1808    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1809    '''
 1810    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1811    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1812    '''
 1813    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1814    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1815    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1816    ''' </param>
 1817    ''' <param name="eventType">
 1818    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1819    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1820    ''' </param>
 1821    ''' <param name="eventID">
 1822    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 1823    ''' </param>
 1824    ''' <param name="category">
 1825    ''' The category for the event, if applicable. This is typically used in categorized event views.
 1826    ''' </param>
 1827    ''' <param name="EntrySeverity">
 1828    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1829    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1830    ''' will be skipped and not written to the Event Log.
 1831    ''' </param>
 1832    ''' <remarks>
 1833    ''' <para>
 1834    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1835    ''' </para>
 1836    ''' <para>
 1837    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1838    ''' </para>
 1839    ''' </remarks>
 721840    Public Sub Log(
 721841            ByVal logName As String,
 721842            ByVal sourceName As String,
 721843            ByVal message As String,
 721844            ByVal eventType As EventLogEntryType,
 721845            ByVal eventID As Integer,
 721846            ByVal category As Short,
 721847            ByVal EntrySeverity As LoggingSeverity)
 1848
 1441849        Log("",
 1441850            logName,
 1441851            sourceName,
 1441852            message,
 1441853            eventType,
 1441854            eventID,
 1441855            category,
 1441856            Nothing,
 1441857            EntrySeverity)
 1858
 1441859    End Sub
 1860
 1861    ''' <summary>
 1862    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1863    ''' </summary>
 1864    ''' <param name="message">
 1865    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1866    '''
 1867    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1868    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1869    '''
 1870    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1871    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1872    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1873    ''' </param>
 1874    ''' <param name="rawData">
 1875    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 1876    ''' </param>
 1877    ''' <remarks>
 1878    ''' <para>
 1879    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1880    ''' </para>
 1881    ''' <para>
 1882    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1883    ''' </para>
 1884    ''' </remarks>
 41885    Public Sub Log(
 41886            ByVal message As String,
 41887            ByVal rawData As Byte())
 1888
 81889        Log(message,
 81890            EventLogEntryType.Information,
 81891            rawData)
 1892
 81893    End Sub
 1894
 1895    ''' <summary>
 1896    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1897    ''' </summary>
 1898    ''' <param name="message">
 1899    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1900    '''
 1901    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1902    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1903    '''
 1904    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1905    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1906    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1907    ''' </param>
 1908    ''' <param name="rawData">
 1909    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 1910    ''' </param>
 1911    ''' <param name="EntrySeverity">
 1912    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1913    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1914    ''' will be skipped and not written to the Event Log.
 1915    ''' </param>
 1916    ''' <remarks>
 1917    ''' <para>
 1918    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1919    ''' </para>
 1920    ''' <para>
 1921    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1922    ''' </para>
 1923    ''' </remarks>
 41924    Public Sub Log(
 41925            ByVal message As String,
 41926            ByVal rawData As Byte(),
 41927            ByVal EntrySeverity As LoggingSeverity)
 1928
 81929        Log(message,
 81930            EventLogEntryType.Information,
 81931            rawData,
 81932            EntrySeverity)
 1933
 81934    End Sub
 1935
 1936    ''' <summary>
 1937    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1938    ''' </summary>
 1939    ''' <param name="message">
 1940    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1941    '''
 1942    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1943    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1944    '''
 1945    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1946    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1947    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1948    ''' </param>
 1949    ''' <param name="eventType">
 1950    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1951    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1952    ''' </param>
 1953    ''' <param name="rawData">
 1954    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 1955    ''' </param>
 1956    ''' <remarks>
 1957    ''' <para>
 1958    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 1959    ''' </para>
 1960    ''' <para>
 1961    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 1962    ''' </para>
 1963    ''' </remarks>
 81964    Public Sub Log(
 81965            ByVal message As String,
 81966            ByVal eventType As EventLogEntryType,
 81967            ByVal rawData As Byte())
 1968
 161969        Log(message,
 161970            eventType,
 161971            0,
 161972            rawData)
 1973
 161974    End Sub
 1975
 1976    ''' <summary>
 1977    ''' Writes an entry to the Windows Event Log using the provided parameters.
 1978    ''' </summary>
 1979    ''' <param name="message">
 1980    ''' The message to log. If <c>null</c> or empty, a default message is used.
 1981    '''
 1982    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 1983    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 1984    '''
 1985    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 1986    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 1987    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 1988    ''' </param>
 1989    ''' <param name="eventType">
 1990    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 1991    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 1992    ''' </param>
 1993    ''' <param name="rawData">
 1994    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 1995    ''' </param>
 1996    ''' <param name="EntrySeverity">
 1997    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 1998    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 1999    ''' will be skipped and not written to the Event Log.
 2000    ''' </param>
 2001    ''' <remarks>
 2002    ''' <para>
 2003    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2004    ''' </para>
 2005    ''' <para>
 2006    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2007    ''' </para>
 2008    ''' </remarks>
 42009    Public Sub Log(
 42010            ByVal message As String,
 42011            ByVal eventType As EventLogEntryType,
 42012            ByVal rawData As Byte(),
 42013            ByVal EntrySeverity As LoggingSeverity)
 2014
 82015        Log(message,
 82016            eventType,
 82017            0,
 82018            rawData,
 82019            EntrySeverity)
 2020
 82021    End Sub
 2022
 2023    ''' <summary>
 2024    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2025    ''' </summary>
 2026    ''' <param name="message">
 2027    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2028    '''
 2029    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2030    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2031    '''
 2032    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2033    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2034    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2035    ''' </param>
 2036    ''' <param name="eventType">
 2037    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2038    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2039    ''' </param>
 2040    ''' <param name="eventID">
 2041    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2042    ''' </param>
 2043    ''' <param name="rawData">
 2044    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2045    ''' </param>
 2046    ''' <remarks>
 2047    ''' <para>
 2048    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2049    ''' </para>
 2050    ''' <para>
 2051    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2052    ''' </para>
 2053    ''' </remarks>
 122054    Public Sub Log(
 122055            ByVal message As String,
 122056            ByVal eventType As EventLogEntryType,
 122057            ByVal eventID As Integer,
 122058            ByVal rawData As Byte())
 2059
 242060        Log(message,
 242061            eventType,
 242062            eventID,
 242063            0,
 242064            rawData)
 2065
 242066    End Sub
 2067
 2068    ''' <summary>
 2069    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2070    ''' </summary>
 2071    ''' <param name="message">
 2072    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2073    '''
 2074    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2075    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2076    '''
 2077    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2078    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2079    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2080    ''' </param>
 2081    ''' <param name="eventType">
 2082    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2083    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2084    ''' </param>
 2085    ''' <param name="eventID">
 2086    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2087    ''' </param>
 2088    ''' <param name="rawData">
 2089    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2090    ''' </param>
 2091    ''' <param name="EntrySeverity">
 2092    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2093    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2094    ''' will be skipped and not written to the Event Log.
 2095    ''' </param>
 2096    ''' <remarks>
 2097    ''' <para>
 2098    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2099    ''' </para>
 2100    ''' <para>
 2101    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2102    ''' </para>
 2103    ''' </remarks>
 42104    Public Sub Log(
 42105            ByVal message As String,
 42106            ByVal eventType As EventLogEntryType,
 42107            ByVal eventID As Integer,
 42108            ByVal rawData As Byte(),
 42109            ByVal EntrySeverity As LoggingSeverity)
 2110
 82111        Log(message,
 82112            eventType,
 82113            eventID,
 82114            0,
 82115            rawData,
 82116            EntrySeverity)
 2117
 82118    End Sub
 2119
 2120    ''' <summary>
 2121    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2122    ''' </summary>
 2123    ''' <param name="message">
 2124    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2125    '''
 2126    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2127    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2128    '''
 2129    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2130    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2131    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2132    ''' </param>
 2133    ''' <param name="eventType">
 2134    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2135    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2136    ''' </param>
 2137    ''' <param name="eventID">
 2138    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2139    ''' </param>
 2140    ''' <param name="category">
 2141    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2142    ''' </param>
 2143    ''' <param name="rawData">
 2144    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2145    ''' </param>
 2146    ''' <remarks>
 2147    ''' <para>
 2148    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2149    ''' </para>
 2150    ''' <para>
 2151    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2152    ''' </para>
 2153    ''' </remarks>
 162154    Public Sub Log(
 162155            ByVal message As String,
 162156            ByVal eventType As EventLogEntryType,
 162157            ByVal eventID As Integer,
 162158            ByVal category As Short,
 162159            ByVal rawData As Byte())
 2160
 322161        Log("",
 322162            "",
 322163            "",
 322164            message,
 322165            eventType,
 322166            eventID,
 322167            category,
 322168            rawData)
 2169
 322170    End Sub
 2171
 2172    ''' <summary>
 2173    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2174    ''' </summary>
 2175    ''' <param name="message">
 2176    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2177    '''
 2178    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2179    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2180    '''
 2181    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2182    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2183    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2184    ''' </param>
 2185    ''' <param name="eventType">
 2186    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2187    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2188    ''' </param>
 2189    ''' <param name="eventID">
 2190    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2191    ''' </param>
 2192    ''' <param name="category">
 2193    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2194    ''' </param>
 2195    ''' <param name="rawData">
 2196    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2197    ''' </param>
 2198    ''' <param name="EntrySeverity">
 2199    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2200    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2201    ''' will be skipped and not written to the Event Log.
 2202    ''' </param>
 2203    ''' <remarks>
 2204    ''' <para>
 2205    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2206    ''' </para>
 2207    ''' <para>
 2208    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2209    ''' </para>
 2210    ''' </remarks>
 42211    Public Sub Log(
 42212            ByVal message As String,
 42213            ByVal eventType As EventLogEntryType,
 42214            ByVal eventID As Integer,
 42215            ByVal category As Short,
 42216            ByVal rawData As Byte(),
 42217            ByVal EntrySeverity As LoggingSeverity)
 2218
 82219        Log("",
 82220            "",
 82221            "",
 82222            message,
 82223            eventType,
 82224            eventID,
 82225            category,
 82226            rawData,
 82227            EntrySeverity)
 2228
 82229    End Sub
 2230
 2231    ''' <summary>
 2232    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2233    ''' </summary>
 2234    ''' <param name="sourceName">
 2235    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2236    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2237    ''' </param>
 2238    ''' <param name="message">
 2239    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2240    '''
 2241    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2242    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2243    '''
 2244    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2245    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2246    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2247    ''' </param>
 2248    ''' <param name="eventType">
 2249    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2250    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2251    ''' </param>
 2252    ''' <param name="eventID">
 2253    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2254    ''' </param>
 2255    ''' <param name="category">
 2256    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2257    ''' </param>
 2258    ''' <param name="rawData">
 2259    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2260    ''' </param>
 2261    ''' <remarks>
 2262    ''' <para>
 2263    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2264    ''' </para>
 2265    ''' <para>
 2266    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2267    ''' </para>
 2268    ''' </remarks>
 42269    Public Sub Log(
 42270            ByVal sourceName As String,
 42271            ByVal message As String,
 42272            ByVal eventType As EventLogEntryType,
 42273            ByVal eventID As Integer,
 42274            ByVal category As Short,
 42275            ByVal rawData As Byte())
 2276
 82277        Log("",
 82278            "",
 82279            sourceName,
 82280            message,
 82281            eventType,
 82282            eventID,
 82283            category,
 82284            rawData)
 2285
 82286    End Sub
 2287
 2288    ''' <summary>
 2289    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2290    ''' </summary>
 2291    ''' <param name="sourceName">
 2292    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2293    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2294    ''' </param>
 2295    ''' <param name="message">
 2296    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2297    '''
 2298    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2299    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2300    '''
 2301    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2302    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2303    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2304    ''' </param>
 2305    ''' <param name="eventType">
 2306    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2307    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2308    ''' </param>
 2309    ''' <param name="eventID">
 2310    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2311    ''' </param>
 2312    ''' <param name="category">
 2313    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2314    ''' </param>
 2315    ''' <param name="rawData">
 2316    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2317    ''' </param>
 2318    ''' <param name="EntrySeverity">
 2319    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2320    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2321    ''' will be skipped and not written to the Event Log.
 2322    ''' </param>
 2323    ''' <remarks>
 2324    ''' <para>
 2325    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2326    ''' </para>
 2327    ''' <para>
 2328    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2329    ''' </para>
 2330    ''' </remarks>
 42331    Public Sub Log(
 42332            ByVal sourceName As String,
 42333            ByVal message As String,
 42334            ByVal eventType As EventLogEntryType,
 42335            ByVal eventID As Integer,
 42336            ByVal category As Short,
 42337            ByVal rawData As Byte(),
 42338            ByVal EntrySeverity As LoggingSeverity)
 2339
 82340        Log("",
 82341            "",
 82342            sourceName,
 82343            message,
 82344            eventType,
 82345            eventID,
 82346            category,
 82347            rawData,
 82348            EntrySeverity)
 2349
 82350    End Sub
 2351
 2352    ''' <summary>
 2353    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2354    ''' </summary>
 2355    ''' <param name="logName">
 2356    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2357    ''' If <c>null</c> or empty, "Application" is used by default.
 2358    ''' </param>
 2359    ''' <param name="source">
 2360    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2361    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2362    ''' </param>
 2363    ''' <param name="message">
 2364    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2365    '''
 2366    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2367    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2368    '''
 2369    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2370    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2371    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2372    ''' </param>
 2373    ''' <param name="eventType">
 2374    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2375    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2376    ''' </param>
 2377    ''' <param name="eventID">
 2378    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2379    ''' </param>
 2380    ''' <param name="category">
 2381    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2382    ''' </param>
 2383    ''' <param name="rawData">
 2384    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2385    ''' </param>
 2386    ''' <remarks>
 2387    ''' <para>
 2388    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2389    ''' </para>
 2390    ''' <para>
 2391    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2392    ''' </para>
 2393    ''' </remarks>
 402394    Public Sub Log(
 402395            ByVal logName As String,
 402396            ByVal source As String,
 402397            ByVal message As String,
 402398            ByVal eventType As EventLogEntryType,
 402399            ByVal eventID As Integer,
 402400            ByVal category As Short,
 402401            ByVal rawData As Byte())
 2402
 802403        Log(
 802404            "",
 802405            logName,
 802406            source,
 802407            message,
 802408            eventType,
 802409            eventID,
 802410            category,
 802411            rawData)
 2412
 802413    End Sub
 2414
 2415    ''' <summary>
 2416    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2417    ''' </summary>
 2418    ''' <param name="logName">
 2419    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2420    ''' If <c>null</c> or empty, "Application" is used by default.
 2421    ''' </param>
 2422    ''' <param name="source">
 2423    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2424    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2425    ''' </param>
 2426    ''' <param name="message">
 2427    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2428    '''
 2429    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2430    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2431    '''
 2432    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2433    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2434    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2435    ''' </param>
 2436    ''' <param name="eventType">
 2437    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2438    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2439    ''' </param>
 2440    ''' <param name="eventID">
 2441    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2442    ''' </param>
 2443    ''' <param name="category">
 2444    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2445    ''' </param>
 2446    ''' <param name="rawData">
 2447    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2448    ''' </param>
 2449    ''' <param name="EntrySeverity">
 2450    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2451    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2452    ''' will be skipped and not written to the Event Log.
 2453    ''' </param>
 2454    ''' <remarks>
 2455    ''' <para>
 2456    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2457    ''' </para>
 2458    ''' <para>
 2459    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2460    ''' </para>
 2461    ''' </remarks>
 42462    Public Sub Log(
 42463            ByVal logName As String,
 42464            ByVal source As String,
 42465            ByVal message As String,
 42466            ByVal eventType As EventLogEntryType,
 42467            ByVal eventID As Integer,
 42468            ByVal category As Short,
 42469            ByVal rawData As Byte(),
 42470            ByVal EntrySeverity As LoggingSeverity)
 2471
 82472        Log(
 82473            "",
 82474            logName,
 82475            source,
 82476            message,
 82477            eventType,
 82478            eventID,
 82479            category,
 82480            rawData,
 82481            EntrySeverity)
 2482
 82483    End Sub
 2484
 2485    ''' <summary>
 2486    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2487    ''' </summary>
 2488    ''' <param name="logName">
 2489    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2490    ''' If <c>null</c> or empty, "Application" is used by default.
 2491    ''' </param>
 2492    ''' <param name="source">
 2493    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2494    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2495    ''' </param>
 2496    ''' <param name="message">
 2497    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2498    '''
 2499    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2500    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2501    '''
 2502    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2503    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2504    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2505    ''' </param>
 2506    ''' <param name="eventType">
 2507    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2508    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2509    ''' </param>
 2510    ''' <param name="eventID">
 2511    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2512    ''' </param>
 2513    ''' <param name="category">
 2514    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2515    ''' </param>
 2516    ''' <param name="rawData">
 2517    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2518    ''' </param>
 2519    ''' <remarks>
 2520    ''' <para>
 2521    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2522    ''' </para>
 2523    ''' <para>
 2524    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2525    ''' </para>
 2526    ''' </remarks>
 722527    Public Sub Log(
 722528            ByVal machineName As String,
 722529            ByVal logName As String,
 722530            ByVal source As String,
 722531            ByVal message As String,
 722532            ByVal eventType As EventLogEntryType,
 722533            ByVal eventID As Integer,
 722534            ByVal category As Short,
 722535            ByVal rawData As Byte())
 2536
 1442537        Initialize()
 1442538        Log(
 1442539            machineName,
 1442540            logName,
 1442541            source,
 1442542            message,
 1442543            eventType,
 1442544            eventID,
 1442545            category,
 1442546            rawData,
 1442547            MaxKilobytes)
 2548
 1442549    End Sub
 2550
 2551    ''' <summary>
 2552    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2553    ''' </summary>
 2554    ''' <param name="logName">
 2555    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2556    ''' If <c>null</c> or empty, "Application" is used by default.
 2557    ''' </param>
 2558    ''' <param name="source">
 2559    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2560    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2561    ''' </param>
 2562    ''' <param name="message">
 2563    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2564    '''
 2565    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2566    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2567    '''
 2568    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2569    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2570    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2571    ''' </param>
 2572    ''' <param name="eventType">
 2573    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2574    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2575    ''' </param>
 2576    ''' <param name="eventID">
 2577    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2578    ''' </param>
 2579    ''' <param name="category">
 2580    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2581    ''' </param>
 2582    ''' <param name="rawData">
 2583    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2584    ''' </param>
 2585    ''' <param name="EntrySeverity">
 2586    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2587    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2588    ''' will be skipped and not written to the Event Log.
 2589    ''' </param>
 2590    ''' <remarks>
 2591    ''' <para>
 2592    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2593    ''' </para>
 2594    ''' <para>
 2595    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2596    ''' </para>
 2597    ''' </remarks>
 842598    Public Sub Log(
 842599            ByVal machineName As String,
 842600            ByVal logName As String,
 842601            ByVal source As String,
 842602            ByVal message As String,
 842603            ByVal eventType As EventLogEntryType,
 842604            ByVal eventID As Integer,
 842605            ByVal category As Short,
 842606            ByVal rawData As Byte(),
 842607            ByVal EntrySeverity As LoggingSeverity)
 2608
 1682609        Initialize()
 1682610        Log(
 1682611            machineName,
 1682612            logName,
 1682613            source,
 1682614            message,
 1682615            eventType,
 1682616            eventID,
 1682617            category,
 1682618            rawData,
 1682619            MaxKilobytes,
 1682620            EntrySeverity)
 2621
 1682622    End Sub
 2623
 2624    ''' <summary>
 2625    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2626    ''' </summary>
 2627    ''' <param name="logName">
 2628    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2629    ''' If <c>null</c> or empty, "Application" is used by default.
 2630    ''' </param>
 2631    ''' <param name="source">
 2632    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2633    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2634    ''' </param>
 2635    ''' <param name="message">
 2636    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2637    '''
 2638    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2639    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2640    '''
 2641    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2642    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2643    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2644    ''' </param>
 2645    ''' <param name="eventType">
 2646    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2647    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2648    ''' </param>
 2649    ''' <param name="eventID">
 2650    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2651    ''' </param>
 2652    ''' <param name="category">
 2653    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2654    ''' </param>
 2655    ''' <param name="rawData">
 2656    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2657    ''' </param>
 2658    ''' <param name="maxKilobytes">
 2659    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2660    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2661    ''' </param>
 2662    ''' <remarks>
 2663    ''' <para>
 2664    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2665    ''' </para>
 2666    ''' <para>
 2667    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2668    ''' </para>
 2669    ''' </remarks>
 722670    Public Sub Log(
 722671            ByVal machineName As String,
 722672            ByVal logName As String,
 722673            ByVal source As String,
 722674            ByVal message As String,
 722675            ByVal eventType As EventLogEntryType,
 722676            ByVal eventID As Integer,
 722677            ByVal category As Short,
 722678            ByVal rawData As Byte(),
 722679            ByVal maxKilobytes As Integer)
 2680
 1442681        Initialize()
 1442682        Log(
 1442683            machineName,
 1442684            logName,
 1442685            source,
 1442686            message,
 1442687            eventType,
 1442688            eventID,
 1442689            category,
 1442690            rawData,
 1442691            maxKilobytes,
 1442692            RetentionDays)
 2693
 1442694    End Sub
 2695
 2696    ''' <summary>
 2697    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2698    ''' </summary>
 2699    ''' <param name="logName">
 2700    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 2701    ''' If <c>null</c> or empty, "Application" is used by default.
 2702    ''' </param>
 2703    ''' <param name="source">
 2704    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 2705    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 2706    ''' </param>
 2707    ''' <param name="message">
 2708    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2709    '''
 2710    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2711    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2712    '''
 2713    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2714    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2715    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2716    ''' </param>
 2717    ''' <param name="eventType">
 2718    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2719    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2720    ''' </param>
 2721    ''' <param name="eventID">
 2722    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2723    ''' </param>
 2724    ''' <param name="category">
 2725    ''' The category for the event, if applicable. This is typically used in categorized event views.
 2726    ''' </param>
 2727    ''' <param name="rawData">
 2728    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 2729    ''' </param>
 2730    ''' <param name="maxKilobytes">
 2731    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2732    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2733    ''' </param>
 2734    ''' <param name="EntrySeverity">
 2735    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2736    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2737    ''' will be skipped and not written to the Event Log.
 2738    ''' </param>
 2739    ''' <remarks>
 2740    ''' <para>
 2741    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2742    ''' </para>
 2743    ''' <para>
 2744    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2745    ''' </para>
 2746    ''' </remarks>
 842747    Public Sub Log(
 842748            ByVal machineName As String,
 842749            ByVal logName As String,
 842750            ByVal source As String,
 842751            ByVal message As String,
 842752            ByVal eventType As EventLogEntryType,
 842753            ByVal eventID As Integer,
 842754            ByVal category As Short,
 842755            ByVal rawData As Byte(),
 842756            ByVal maxKilobytes As Integer,
 842757            ByVal EntrySeverity As LoggingSeverity)
 2758
 1682759        Initialize()
 1682760        Log(
 1682761            machineName,
 1682762            logName,
 1682763            source,
 1682764            message,
 1682765            eventType,
 1682766            eventID,
 1682767            category,
 1682768            rawData,
 1682769            maxKilobytes,
 1682770            RetentionDays,
 1682771            EntrySeverity)
 2772
 1682773    End Sub
 2774
 2775    ''' <summary>
 2776    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2777    ''' </summary>
 2778    ''' <param name="message">
 2779    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2780    '''
 2781    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2782    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2783    '''
 2784    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2785    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2786    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2787    ''' </param>
 2788    ''' <param name="maxKilobytes">
 2789    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2790    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2791    ''' </param>
 2792    ''' <param name="retentionDays">
 2793    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 2794    ''' Only used when creating a new log.
 2795    ''' </param>
 2796    ''' <remarks>
 2797    ''' <para>
 2798    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2799    ''' </para>
 2800    ''' <para>
 2801    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2802    ''' </para>
 2803    ''' </remarks>
 42804    Public Sub Log(
 42805            ByVal message As String,
 42806            ByVal maxKilobytes As Integer,
 42807            ByVal retentionDays As Integer)
 2808
 82809        Log(
 82810            message,
 82811            EventLogEntryType.Information,
 82812            maxKilobytes,
 82813            retentionDays)
 2814
 82815    End Sub
 2816
 2817    ''' <summary>
 2818    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2819    ''' </summary>
 2820    ''' <param name="message">
 2821    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2822    '''
 2823    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2824    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2825    '''
 2826    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2827    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2828    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2829    ''' </param>
 2830    ''' <param name="maxKilobytes">
 2831    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2832    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2833    ''' </param>
 2834    ''' <param name="retentionDays">
 2835    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 2836    ''' Only used when creating a new log.
 2837    ''' </param>
 2838    ''' <param name="EntrySeverity">
 2839    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2840    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2841    ''' will be skipped and not written to the Event Log.
 2842    ''' </param>
 2843    ''' <remarks>
 2844    ''' <para>
 2845    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2846    ''' </para>
 2847    ''' <para>
 2848    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2849    ''' </para>
 2850    ''' </remarks>
 42851    Public Sub Log(
 42852            ByVal message As String,
 42853            ByVal maxKilobytes As Integer,
 42854            ByVal retentionDays As Integer,
 42855            ByVal EntrySeverity As LoggingSeverity)
 2856
 82857        Log(
 82858            message,
 82859            EventLogEntryType.Information,
 82860            maxKilobytes,
 82861            retentionDays,
 82862            EntrySeverity)
 2863
 82864    End Sub
 2865
 2866    ''' <summary>
 2867    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2868    ''' </summary>
 2869    ''' <param name="message">
 2870    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2871    '''
 2872    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2873    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2874    '''
 2875    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2876    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2877    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2878    ''' </param>
 2879    ''' <param name="eventType">
 2880    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2881    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2882    ''' </param>
 2883    ''' <param name="maxKilobytes">
 2884    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2885    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2886    ''' </param>
 2887    ''' <param name="retentionDays">
 2888    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 2889    ''' Only used when creating a new log.
 2890    ''' </param>
 2891    ''' <remarks>
 2892    ''' <para>
 2893    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2894    ''' </para>
 2895    ''' <para>
 2896    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2897    ''' </para>
 2898    ''' </remarks>
 42899    Public Sub Log(
 42900            ByVal message As String,
 42901            ByVal eventType As EventLogEntryType,
 42902            ByVal maxKilobytes As Integer,
 42903            ByVal retentionDays As Integer)
 2904
 82905        Log(
 82906            message,
 82907            eventType,
 82908            0,
 82909            maxKilobytes,
 82910            retentionDays)
 2911
 82912    End Sub
 2913
 2914    ''' <summary>
 2915    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2916    ''' </summary>
 2917    ''' <param name="message">
 2918    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2919    '''
 2920    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2921    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2922    '''
 2923    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2924    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2925    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2926    ''' </param>
 2927    ''' <param name="eventType">
 2928    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2929    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2930    ''' </param>
 2931    ''' <param name="maxKilobytes">
 2932    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2933    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2934    ''' </param>
 2935    ''' <param name="retentionDays">
 2936    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 2937    ''' Only used when creating a new log.
 2938    ''' </param>
 2939    ''' <param name="EntrySeverity">
 2940    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 2941    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 2942    ''' will be skipped and not written to the Event Log.
 2943    ''' </param>
 2944    ''' <remarks>
 2945    ''' <para>
 2946    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 2947    ''' </para>
 2948    ''' <para>
 2949    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 2950    ''' </para>
 2951    ''' </remarks>
 42952    Public Sub Log(
 42953            ByVal message As String,
 42954            ByVal eventType As EventLogEntryType,
 42955            ByVal maxKilobytes As Integer,
 42956            ByVal retentionDays As Integer,
 42957            ByVal EntrySeverity As LoggingSeverity)
 2958
 82959        Log(
 82960            message,
 82961            eventType,
 82962            0,
 82963            maxKilobytes,
 82964            retentionDays,
 82965            EntrySeverity)
 2966
 82967    End Sub
 2968
 2969    ''' <summary>
 2970    ''' Writes an entry to the Windows Event Log using the provided parameters.
 2971    ''' </summary>
 2972    ''' <param name="message">
 2973    ''' The message to log. If <c>null</c> or empty, a default message is used.
 2974    '''
 2975    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 2976    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 2977    '''
 2978    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 2979    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 2980    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 2981    ''' </param>
 2982    ''' <param name="eventType">
 2983    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 2984    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 2985    ''' </param>
 2986    ''' <param name="eventID">
 2987    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 2988    ''' </param>
 2989    ''' <param name="maxKilobytes">
 2990    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 2991    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 2992    ''' </param>
 2993    ''' <param name="retentionDays">
 2994    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 2995    ''' Only used when creating a new log.
 2996    ''' </param>
 2997    ''' <remarks>
 2998    ''' <para>
 2999    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3000    ''' </para>
 3001    ''' <para>
 3002    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3003    ''' </para>
 3004    ''' </remarks>
 43005    Public Sub Log(
 43006            ByVal message As String,
 43007            ByVal eventType As EventLogEntryType,
 43008            ByVal eventID As Integer,
 43009            ByVal maxKilobytes As Integer,
 43010            ByVal retentionDays As Integer)
 3011
 83012        Log(
 83013            message,
 83014            eventType,
 83015            eventID,
 83016            0,
 83017            maxKilobytes,
 83018            retentionDays)
 3019
 83020    End Sub
 3021
 3022    ''' <summary>
 3023    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3024    ''' </summary>
 3025    ''' <param name="message">
 3026    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3027    '''
 3028    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3029    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3030    '''
 3031    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3032    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3033    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3034    ''' </param>
 3035    ''' <param name="eventType">
 3036    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3037    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3038    ''' </param>
 3039    ''' <param name="eventID">
 3040    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3041    ''' </param>
 3042    ''' <param name="maxKilobytes">
 3043    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3044    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3045    ''' </param>
 3046    ''' <param name="retentionDays">
 3047    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3048    ''' Only used when creating a new log.
 3049    ''' </param>
 3050    ''' <param name="EntrySeverity">
 3051    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3052    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3053    ''' will be skipped and not written to the Event Log.
 3054    ''' </param>
 3055    ''' <remarks>
 3056    ''' <para>
 3057    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3058    ''' </para>
 3059    ''' <para>
 3060    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3061    ''' </para>
 3062    ''' </remarks>
 43063    Public Sub Log(
 43064            ByVal message As String,
 43065            ByVal eventType As EventLogEntryType,
 43066            ByVal eventID As Integer,
 43067            ByVal maxKilobytes As Integer,
 43068            ByVal retentionDays As Integer,
 43069            ByVal EntrySeverity As LoggingSeverity)
 3070
 83071        Log(
 83072            message,
 83073            eventType,
 83074            eventID,
 83075            0,
 83076            maxKilobytes,
 83077            retentionDays,
 83078            EntrySeverity)
 3079
 83080    End Sub
 3081
 3082    ''' <summary>
 3083    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3084    ''' </summary>
 3085    ''' <param name="message">
 3086    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3087    '''
 3088    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3089    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3090    '''
 3091    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3092    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3093    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3094    ''' </param>
 3095    ''' <param name="eventType">
 3096    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3097    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3098    ''' </param>
 3099    ''' <param name="eventID">
 3100    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3101    ''' </param>
 3102    ''' <param name="category">
 3103    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3104    ''' </param>
 3105    ''' <param name="maxKilobytes">
 3106    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3107    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3108    ''' </param>
 3109    ''' <param name="retentionDays">
 3110    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3111    ''' Only used when creating a new log.
 3112    ''' </param>
 3113    ''' <remarks>
 3114    ''' <para>
 3115    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3116    ''' </para>
 3117    ''' <para>
 3118    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3119    ''' </para>
 3120    ''' </remarks>
 43121    Public Sub Log(
 43122            ByVal message As String,
 43123            ByVal eventType As EventLogEntryType,
 43124            ByVal eventID As Integer,
 43125            ByVal category As Short,
 43126            ByVal maxKilobytes As Integer,
 43127            ByVal retentionDays As Integer)
 3128
 83129        Log(
 83130            message,
 83131            eventType,
 83132            eventID,
 83133            category,
 83134            Nothing,
 83135            maxKilobytes,
 83136            retentionDays)
 3137
 83138    End Sub
 3139
 3140    ''' <summary>
 3141    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3142    ''' </summary>
 3143    ''' <param name="message">
 3144    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3145    '''
 3146    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3147    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3148    '''
 3149    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3150    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3151    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3152    ''' </param>
 3153    ''' <param name="eventType">
 3154    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3155    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3156    ''' </param>
 3157    ''' <param name="eventID">
 3158    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3159    ''' </param>
 3160    ''' <param name="category">
 3161    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3162    ''' </param>
 3163    ''' <param name="maxKilobytes">
 3164    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3165    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3166    ''' </param>
 3167    ''' <param name="retentionDays">
 3168    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3169    ''' Only used when creating a new log.
 3170    ''' </param>
 3171    ''' <param name="EntrySeverity">
 3172    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3173    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3174    ''' will be skipped and not written to the Event Log.
 3175    ''' </param>
 3176    ''' <remarks>
 3177    ''' <para>
 3178    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3179    ''' </para>
 3180    ''' <para>
 3181    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3182    ''' </para>
 3183    ''' </remarks>
 43184    Public Sub Log(
 43185            ByVal message As String,
 43186            ByVal eventType As EventLogEntryType,
 43187            ByVal eventID As Integer,
 43188            ByVal category As Short,
 43189            ByVal maxKilobytes As Integer,
 43190            ByVal retentionDays As Integer,
 43191            ByVal EntrySeverity As LoggingSeverity)
 3192
 83193        Log(
 83194            message,
 83195            eventType,
 83196            eventID,
 83197            category,
 83198            Nothing,
 83199            maxKilobytes,
 83200            retentionDays,
 83201            EntrySeverity)
 3202
 83203    End Sub
 3204
 3205    ''' <summary>
 3206    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3207    ''' </summary>
 3208    ''' <param name="message">
 3209    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3210    '''
 3211    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3212    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3213    '''
 3214    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3215    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3216    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3217    ''' </param>
 3218    ''' <param name="eventType">
 3219    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3220    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3221    ''' </param>
 3222    ''' <param name="eventID">
 3223    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3224    ''' </param>
 3225    ''' <param name="category">
 3226    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3227    ''' </param>
 3228    ''' <param name="rawData">
 3229    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3230    ''' </param>
 3231    ''' <param name="maxKilobytes">
 3232    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3233    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3234    ''' </param>
 3235    ''' <param name="retentionDays">
 3236    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3237    ''' Only used when creating a new log.
 3238    ''' </param>
 3239    ''' <remarks>
 3240    ''' <para>
 3241    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3242    ''' </para>
 3243    ''' <para>
 3244    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3245    ''' </para>
 3246    ''' </remarks>
 43247    Public Sub Log(
 43248            ByVal message As String,
 43249            ByVal eventType As EventLogEntryType,
 43250            ByVal eventID As Integer,
 43251            ByVal category As Short,
 43252            ByVal rawData As Byte(),
 43253            ByVal maxKilobytes As Integer,
 43254            ByVal retentionDays As Integer)
 3255
 83256        Log(
 83257            "",
 83258            message,
 83259            eventType,
 83260            eventID,
 83261            category,
 83262            rawData,
 83263            maxKilobytes,
 83264            retentionDays)
 3265
 83266    End Sub
 3267
 3268    ''' <summary>
 3269    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3270    ''' </summary>
 3271    ''' <param name="message">
 3272    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3273    '''
 3274    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3275    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3276    '''
 3277    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3278    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3279    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3280    ''' </param>
 3281    ''' <param name="eventType">
 3282    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3283    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3284    ''' </param>
 3285    ''' <param name="eventID">
 3286    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3287    ''' </param>
 3288    ''' <param name="category">
 3289    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3290    ''' </param>
 3291    ''' <param name="rawData">
 3292    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3293    ''' </param>
 3294    ''' <param name="maxKilobytes">
 3295    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3296    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3297    ''' </param>
 3298    ''' <param name="retentionDays">
 3299    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3300    ''' Only used when creating a new log.
 3301    ''' </param>
 3302    ''' <param name="EntrySeverity">
 3303    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3304    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3305    ''' will be skipped and not written to the Event Log.
 3306    ''' </param>
 3307    ''' <remarks>
 3308    ''' <para>
 3309    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3310    ''' </para>
 3311    ''' <para>
 3312    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3313    ''' </para>
 3314    ''' </remarks>
 43315    Public Sub Log(
 43316            ByVal message As String,
 43317            ByVal eventType As EventLogEntryType,
 43318            ByVal eventID As Integer,
 43319            ByVal category As Short,
 43320            ByVal rawData As Byte(),
 43321            ByVal maxKilobytes As Integer,
 43322            ByVal retentionDays As Integer,
 43323            ByVal EntrySeverity As LoggingSeverity)
 3324
 83325        Log(
 83326            "",
 83327            message,
 83328            eventType,
 83329            eventID,
 83330            category,
 83331            rawData,
 83332            maxKilobytes,
 83333            retentionDays,
 83334            EntrySeverity)
 3335
 83336    End Sub
 3337
 3338    ''' <summary>
 3339    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3340    ''' </summary>
 3341    ''' <param name="source">
 3342    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3343    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3344    ''' </param>
 3345    ''' <param name="message">
 3346    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3347    '''
 3348    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3349    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3350    '''
 3351    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3352    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3353    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3354    ''' </param>
 3355    ''' <param name="eventType">
 3356    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3357    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3358    ''' </param>
 3359    ''' <param name="eventID">
 3360    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3361    ''' </param>
 3362    ''' <param name="category">
 3363    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3364    ''' </param>
 3365    ''' <param name="rawData">
 3366    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3367    ''' </param>
 3368    ''' <param name="maxKilobytes">
 3369    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3370    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3371    ''' </param>
 3372    ''' <param name="retentionDays">
 3373    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3374    ''' Only used when creating a new log.
 3375    ''' </param>
 3376    ''' <remarks>
 3377    ''' <para>
 3378    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3379    ''' </para>
 3380    ''' <para>
 3381    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3382    ''' </para>
 3383    ''' </remarks>
 43384    Public Sub Log(
 43385            ByVal source As String,
 43386            ByVal message As String,
 43387            ByVal eventType As EventLogEntryType,
 43388            ByVal eventID As Integer,
 43389            ByVal category As Short,
 43390            ByVal rawData As Byte(),
 43391            ByVal maxKilobytes As Integer,
 43392            ByVal retentionDays As Integer)
 3393
 83394        Log(
 83395            "",
 83396            source,
 83397            message,
 83398            eventType,
 83399            eventID,
 83400            category,
 83401            rawData,
 83402            maxKilobytes,
 83403            retentionDays)
 3404
 83405    End Sub
 3406
 3407    ''' <summary>
 3408    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3409    ''' </summary>
 3410    ''' <param name="source">
 3411    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3412    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3413    ''' </param>
 3414    ''' <param name="message">
 3415    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3416    '''
 3417    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3418    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3419    '''
 3420    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3421    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3422    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3423    ''' </param>
 3424    ''' <param name="eventType">
 3425    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3426    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3427    ''' </param>
 3428    ''' <param name="eventID">
 3429    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3430    ''' </param>
 3431    ''' <param name="category">
 3432    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3433    ''' </param>
 3434    ''' <param name="rawData">
 3435    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3436    ''' </param>
 3437    ''' <param name="maxKilobytes">
 3438    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3439    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3440    ''' </param>
 3441    ''' <param name="retentionDays">
 3442    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3443    ''' Only used when creating a new log.
 3444    ''' </param>
 3445    ''' <param name="EntrySeverity">
 3446    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3447    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3448    ''' will be skipped and not written to the Event Log.
 3449    ''' </param>
 3450    ''' <remarks>
 3451    ''' <para>
 3452    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3453    ''' </para>
 3454    ''' <para>
 3455    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3456    ''' </para>
 3457    ''' </remarks>
 43458    Public Sub Log(
 43459            ByVal source As String,
 43460            ByVal message As String,
 43461            ByVal eventType As EventLogEntryType,
 43462            ByVal eventID As Integer,
 43463            ByVal category As Short,
 43464            ByVal rawData As Byte(),
 43465            ByVal maxKilobytes As Integer,
 43466            ByVal retentionDays As Integer,
 43467            ByVal EntrySeverity As LoggingSeverity)
 3468
 83469        Log(
 83470            "",
 83471            source,
 83472            message,
 83473            eventType,
 83474            eventID,
 83475            category,
 83476            rawData,
 83477            maxKilobytes,
 83478            retentionDays,
 83479            EntrySeverity)
 3480
 83481    End Sub
 3482
 3483    ''' <summary>
 3484    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3485    ''' </summary>
 3486    ''' <param name="logName">
 3487    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 3488    ''' If <c>null</c> or empty, "Application" is used by default.
 3489    ''' </param>
 3490    ''' <param name="source">
 3491    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3492    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3493    ''' </param>
 3494    ''' <param name="message">
 3495    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3496    '''
 3497    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3498    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3499    '''
 3500    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3501    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3502    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3503    ''' </param>
 3504    ''' <param name="eventType">
 3505    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3506    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3507    ''' </param>
 3508    ''' <param name="eventID">
 3509    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3510    ''' </param>
 3511    ''' <param name="category">
 3512    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3513    ''' </param>
 3514    ''' <param name="rawData">
 3515    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3516    ''' </param>
 3517    ''' <param name="maxKilobytes">
 3518    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3519    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3520    ''' </param>
 3521    ''' <param name="retentionDays">
 3522    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3523    ''' Only used when creating a new log.
 3524    ''' </param>
 3525    ''' <remarks>
 3526    ''' <para>
 3527    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3528    ''' </para>
 3529    ''' <para>
 3530    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3531    ''' </para>
 3532    ''' </remarks>
 43533    Public Sub Log(
 43534            ByVal logName As String,
 43535            ByVal source As String,
 43536            ByVal message As String,
 43537            ByVal eventType As EventLogEntryType,
 43538            ByVal eventID As Integer,
 43539            ByVal category As Short,
 43540            ByVal rawData As Byte(),
 43541            ByVal maxKilobytes As Integer,
 43542            ByVal retentionDays As Integer)
 3543
 83544        Log(
 83545            "",
 83546            logName,
 83547            source,
 83548            message,
 83549            eventType,
 83550            eventID,
 83551            category,
 83552            rawData,
 83553            maxKilobytes,
 83554            retentionDays)
 3555
 83556    End Sub
 3557
 3558    ''' <summary>
 3559    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3560    ''' </summary>
 3561    ''' <param name="logName">
 3562    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 3563    ''' If <c>null</c> or empty, "Application" is used by default.
 3564    ''' </param>
 3565    ''' <param name="source">
 3566    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3567    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3568    ''' </param>
 3569    ''' <param name="message">
 3570    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3571    '''
 3572    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3573    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3574    '''
 3575    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3576    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3577    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3578    ''' </param>
 3579    ''' <param name="eventType">
 3580    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3581    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3582    ''' </param>
 3583    ''' <param name="eventID">
 3584    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3585    ''' </param>
 3586    ''' <param name="category">
 3587    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3588    ''' </param>
 3589    ''' <param name="rawData">
 3590    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3591    ''' </param>
 3592    ''' <param name="maxKilobytes">
 3593    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3594    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3595    ''' </param>
 3596    ''' <param name="retentionDays">
 3597    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3598    ''' Only used when creating a new log.
 3599    ''' </param>
 3600    ''' <param name="EntrySeverity">
 3601    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3602    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3603    ''' will be skipped and not written to the Event Log.
 3604    ''' </param>
 3605    ''' <remarks>
 3606    ''' <para>
 3607    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3608    ''' </para>
 3609    ''' <para>
 3610    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3611    ''' </para>
 3612    ''' </remarks>
 43613    Public Sub Log(
 43614            ByVal logName As String,
 43615            ByVal source As String,
 43616            ByVal message As String,
 43617            ByVal eventType As EventLogEntryType,
 43618            ByVal eventID As Integer,
 43619            ByVal category As Short,
 43620            ByVal rawData As Byte(),
 43621            ByVal maxKilobytes As Integer,
 43622            ByVal retentionDays As Integer,
 43623            ByVal EntrySeverity As LoggingSeverity)
 3624
 83625        Log(
 83626            "",
 83627            logName,
 83628            source,
 83629            message,
 83630            eventType,
 83631            eventID,
 83632            category,
 83633            rawData,
 83634            maxKilobytes,
 83635            retentionDays,
 83636            EntrySeverity)
 3637
 83638    End Sub
 3639
 3640    ''' <summary>
 3641    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3642    ''' </summary>
 3643    ''' <param name="logName">
 3644    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 3645    ''' If <c>null</c> or empty, "Application" is used by default.
 3646    ''' </param>
 3647    ''' <param name="source">
 3648    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3649    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3650    ''' </param>
 3651    ''' <param name="message">
 3652    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3653    '''
 3654    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3655    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3656    '''
 3657    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3658    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3659    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3660    ''' </param>
 3661    ''' <param name="eventType">
 3662    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3663    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3664    ''' </param>
 3665    ''' <param name="eventID">
 3666    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3667    ''' </param>
 3668    ''' <param name="category">
 3669    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3670    ''' </param>
 3671    ''' <param name="rawData">
 3672    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3673    ''' </param>
 3674    ''' <param name="maxKilobytes">
 3675    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3676    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3677    ''' </param>
 3678    ''' <param name="retentionDays">
 3679    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3680    ''' Only used when creating a new log.
 3681    ''' </param>
 3682    ''' <remarks>
 3683    ''' <para>
 3684    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3685    ''' </para>
 3686    ''' <para>
 3687    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3688    ''' </para>
 3689    ''' </remarks>
 763690    Public Sub Log(
 763691            ByVal machineName As String,
 763692            ByVal logName As String,
 763693            ByVal source As String,
 763694            ByVal message As String,
 763695            ByVal eventType As EventLogEntryType,
 763696            ByVal eventID As Integer,
 763697            ByVal category As Short,
 763698            ByVal rawData As Byte(),
 763699            ByVal maxKilobytes As Integer,
 763700            ByVal retentionDays As Integer)
 3701
 1523702        Initialize()
 3703
 1523704        Log(
 1523705            machineName,
 1523706            logName,
 1523707            source,
 1523708            message,
 1523709            eventType,
 1523710            eventID,
 1523711            category,
 1523712            rawData,
 1523713            maxKilobytes,
 1523714            retentionDays,
 1523715            WriteInitEntry)
 3716
 1523717    End Sub
 3718
 3719    ''' <summary>
 3720    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3721    ''' </summary>
 3722    ''' <param name="logName">
 3723    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 3724    ''' If <c>null</c> or empty, "Application" is used by default.
 3725    ''' </param>
 3726    ''' <param name="source">
 3727    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 3728    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 3729    ''' </param>
 3730    ''' <param name="message">
 3731    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3732    '''
 3733    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3734    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3735    '''
 3736    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3737    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3738    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3739    ''' </param>
 3740    ''' <param name="eventType">
 3741    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3742    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3743    ''' </param>
 3744    ''' <param name="eventID">
 3745    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 3746    ''' </param>
 3747    ''' <param name="category">
 3748    ''' The category for the event, if applicable. This is typically used in categorized event views.
 3749    ''' </param>
 3750    ''' <param name="rawData">
 3751    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 3752    ''' </param>
 3753    ''' <param name="maxKilobytes">
 3754    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3755    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3756    ''' </param>
 3757    ''' <param name="retentionDays">
 3758    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3759    ''' Only used when creating a new log.
 3760    ''' </param>
 3761    ''' <param name="EntrySeverity">
 3762    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3763    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3764    ''' will be skipped and not written to the Event Log.
 3765    ''' </param>
 3766    ''' <remarks>
 3767    ''' <para>
 3768    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3769    ''' </para>
 3770    ''' <para>
 3771    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3772    ''' </para>
 3773    ''' </remarks>
 883774    Public Sub Log(
 883775            ByVal machineName As String,
 883776            ByVal logName As String,
 883777            ByVal source As String,
 883778            ByVal message As String,
 883779            ByVal eventType As EventLogEntryType,
 883780            ByVal eventID As Integer,
 883781            ByVal category As Short,
 883782            ByVal rawData As Byte(),
 883783            ByVal maxKilobytes As Integer,
 883784            ByVal retentionDays As Integer,
 883785            ByVal EntrySeverity As LoggingSeverity)
 3786
 1763787        Initialize()
 1763788        Log(
 1763789            machineName,
 1763790            logName,
 1763791            source,
 1763792            message,
 1763793            eventType,
 1763794            eventID,
 1763795            category,
 1763796            rawData,
 1763797            maxKilobytes,
 1763798            retentionDays,
 1763799            WriteInitEntry,
 1763800            EntrySeverity)
 3801
 1763802    End Sub
 3803
 3804    ''' <summary>
 3805    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3806    ''' </summary>
 3807    ''' <param name="message">
 3808    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3809    '''
 3810    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3811    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3812    '''
 3813    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3814    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3815    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3816    ''' </param>
 3817    ''' <param name="maxKilobytes">
 3818    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3819    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3820    ''' </param>
 3821    ''' <param name="retentionDays">
 3822    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3823    ''' Only used when creating a new log.
 3824    ''' </param>
 3825    ''' <param name="writeInitEntry">
 3826    ''' Indicates whether an initialization entry should be written when a new log is created.
 3827    ''' </param>
 3828    ''' <remarks>
 3829    ''' <para>
 3830    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3831    ''' </para>
 3832    ''' <para>
 3833    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3834    ''' </para>
 3835    ''' </remarks>
 43836    Public Sub Log(
 43837            ByVal message As String,
 43838            ByVal maxKilobytes As Integer,
 43839            ByVal retentionDays As Integer,
 43840            ByVal writeInitEntry As Boolean)
 3841
 83842        Log(
 83843            message,
 83844            EventLogEntryType.Information,
 83845            maxKilobytes,
 83846            retentionDays,
 83847            writeInitEntry)
 3848
 83849    End Sub
 3850
 3851    ''' <summary>
 3852    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3853    ''' </summary>
 3854    ''' <param name="message">
 3855    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3856    '''
 3857    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3858    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3859    '''
 3860    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3861    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3862    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3863    ''' </param>
 3864    ''' <param name="maxKilobytes">
 3865    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3866    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3867    ''' </param>
 3868    ''' <param name="retentionDays">
 3869    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3870    ''' Only used when creating a new log.
 3871    ''' </param>
 3872    ''' <param name="writeInitEntry">
 3873    ''' Indicates whether an initialization entry should be written when a new log is created.
 3874    ''' </param>
 3875    ''' <param name="EntrySeverity">
 3876    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3877    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3878    ''' will be skipped and not written to the Event Log.
 3879    ''' </param>
 3880    ''' <remarks>
 3881    ''' <para>
 3882    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3883    ''' </para>
 3884    ''' <para>
 3885    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3886    ''' </para>
 3887    ''' </remarks>
 43888    Public Sub Log(
 43889            ByVal message As String,
 43890            ByVal maxKilobytes As Integer,
 43891            ByVal retentionDays As Integer,
 43892            ByVal writeInitEntry As Boolean,
 43893            ByVal EntrySeverity As LoggingSeverity)
 3894
 83895        Log(
 83896            message,
 83897            EventLogEntryType.Information,
 83898            maxKilobytes,
 83899            retentionDays,
 83900            writeInitEntry,
 83901            EntrySeverity)
 3902
 83903    End Sub
 3904
 3905    ''' <summary>
 3906    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3907    ''' </summary>
 3908    ''' <param name="message">
 3909    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3910    '''
 3911    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3912    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3913    '''
 3914    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3915    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3916    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3917    ''' </param>
 3918    ''' <param name="eventType">
 3919    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3920    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3921    ''' </param>
 3922    ''' <param name="maxKilobytes">
 3923    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3924    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3925    ''' </param>
 3926    ''' <param name="retentionDays">
 3927    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3928    ''' Only used when creating a new log.
 3929    ''' </param>
 3930    ''' <param name="writeInitEntry">
 3931    ''' Indicates whether an initialization entry should be written when a new log is created.
 3932    ''' </param>
 3933    ''' <remarks>
 3934    ''' <para>
 3935    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3936    ''' </para>
 3937    ''' <para>
 3938    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3939    ''' </para>
 3940    ''' </remarks>
 43941    Public Sub Log(
 43942            ByVal message As String,
 43943            ByVal eventType As EventLogEntryType,
 43944            ByVal maxKilobytes As Integer,
 43945            ByVal retentionDays As Integer,
 43946            ByVal writeInitEntry As Boolean)
 3947
 83948        Log(
 83949            message,
 83950            eventType,
 83951            0,
 83952            maxKilobytes,
 83953            retentionDays,
 83954            writeInitEntry)
 3955
 83956    End Sub
 3957
 3958    ''' <summary>
 3959    ''' Writes an entry to the Windows Event Log using the provided parameters.
 3960    ''' </summary>
 3961    ''' <param name="message">
 3962    ''' The message to log. If <c>null</c> or empty, a default message is used.
 3963    '''
 3964    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 3965    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 3966    '''
 3967    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 3968    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 3969    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 3970    ''' </param>
 3971    ''' <param name="eventType">
 3972    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 3973    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 3974    ''' </param>
 3975    ''' <param name="maxKilobytes">
 3976    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 3977    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 3978    ''' </param>
 3979    ''' <param name="retentionDays">
 3980    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 3981    ''' Only used when creating a new log.
 3982    ''' </param>
 3983    ''' <param name="writeInitEntry">
 3984    ''' Indicates whether an initialization entry should be written when a new log is created.
 3985    ''' </param>
 3986    ''' <param name="EntrySeverity">
 3987    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 3988    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 3989    ''' will be skipped and not written to the Event Log.
 3990    ''' </param>
 3991    ''' <remarks>
 3992    ''' <para>
 3993    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 3994    ''' </para>
 3995    ''' <para>
 3996    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 3997    ''' </para>
 3998    ''' </remarks>
 43999    Public Sub Log(
 44000            ByVal message As String,
 44001            ByVal eventType As EventLogEntryType,
 44002            ByVal maxKilobytes As Integer,
 44003            ByVal retentionDays As Integer,
 44004            ByVal writeInitEntry As Boolean,
 44005            ByVal EntrySeverity As LoggingSeverity)
 4006
 84007        Log(
 84008            message,
 84009            eventType,
 84010            0,
 84011            maxKilobytes,
 84012            retentionDays,
 84013            writeInitEntry,
 84014            EntrySeverity)
 4015
 84016    End Sub
 4017
 4018    ''' <summary>
 4019    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4020    ''' </summary>
 4021    ''' <param name="message">
 4022    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4023    '''
 4024    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4025    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4026    '''
 4027    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4028    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4029    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4030    ''' </param>
 4031    ''' <param name="eventType">
 4032    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4033    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4034    ''' </param>
 4035    ''' <param name="eventID">
 4036    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4037    ''' </param>
 4038    ''' <param name="maxKilobytes">
 4039    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4040    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4041    ''' </param>
 4042    ''' <param name="retentionDays">
 4043    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4044    ''' Only used when creating a new log.
 4045    ''' </param>
 4046    ''' <param name="writeInitEntry">
 4047    ''' Indicates whether an initialization entry should be written when a new log is created.
 4048    ''' </param>
 4049    ''' <remarks>
 4050    ''' <para>
 4051    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4052    ''' </para>
 4053    ''' <para>
 4054    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4055    ''' </para>
 4056    ''' </remarks>
 44057    Public Sub Log(
 44058            ByVal message As String,
 44059            ByVal eventType As EventLogEntryType,
 44060            ByVal eventID As Integer,
 44061            ByVal maxKilobytes As Integer,
 44062            ByVal retentionDays As Integer,
 44063            ByVal writeInitEntry As Boolean)
 4064
 84065        Log(
 84066            message,
 84067            eventType,
 84068            eventID,
 84069            0,
 84070            maxKilobytes,
 84071            retentionDays,
 84072            writeInitEntry)
 4073
 84074    End Sub
 4075
 4076    ''' <summary>
 4077    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4078    ''' </summary>
 4079    ''' <param name="message">
 4080    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4081    '''
 4082    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4083    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4084    '''
 4085    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4086    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4087    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4088    ''' </param>
 4089    ''' <param name="eventType">
 4090    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4091    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4092    ''' </param>
 4093    ''' <param name="eventID">
 4094    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4095    ''' </param>
 4096    ''' <param name="maxKilobytes">
 4097    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4098    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4099    ''' </param>
 4100    ''' <param name="retentionDays">
 4101    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4102    ''' Only used when creating a new log.
 4103    ''' </param>
 4104    ''' <param name="writeInitEntry">
 4105    ''' Indicates whether an initialization entry should be written when a new log is created.
 4106    ''' </param>
 4107    ''' <param name="EntrySeverity">
 4108    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4109    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4110    ''' will be skipped and not written to the Event Log.
 4111    ''' </param>
 4112    ''' <remarks>
 4113    ''' <para>
 4114    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4115    ''' </para>
 4116    ''' <para>
 4117    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4118    ''' </para>
 4119    ''' </remarks>
 44120    Public Sub Log(
 44121            ByVal message As String,
 44122            ByVal eventType As EventLogEntryType,
 44123            ByVal eventID As Integer,
 44124            ByVal maxKilobytes As Integer,
 44125            ByVal retentionDays As Integer,
 44126            ByVal writeInitEntry As Boolean,
 44127            ByVal EntrySeverity As LoggingSeverity)
 4128
 84129        Log(
 84130            message,
 84131            eventType,
 84132            eventID,
 84133            0,
 84134            maxKilobytes,
 84135            retentionDays,
 84136            writeInitEntry,
 84137            EntrySeverity)
 4138
 84139    End Sub
 4140
 4141    ''' <summary>
 4142    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4143    ''' </summary>
 4144    ''' <param name="message">
 4145    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4146    '''
 4147    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4148    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4149    '''
 4150    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4151    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4152    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4153    ''' </param>
 4154    ''' <param name="eventType">
 4155    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4156    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4157    ''' </param>
 4158    ''' <param name="eventID">
 4159    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4160    ''' </param>
 4161    ''' <param name="category">
 4162    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4163    ''' </param>
 4164    ''' <param name="maxKilobytes">
 4165    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4166    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4167    ''' </param>
 4168    ''' <param name="retentionDays">
 4169    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4170    ''' Only used when creating a new log.
 4171    ''' </param>
 4172    ''' <param name="writeInitEntry">
 4173    ''' Indicates whether an initialization entry should be written when a new log is created.
 4174    ''' </param>
 4175    ''' <remarks>
 4176    ''' <para>
 4177    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4178    ''' </para>
 4179    ''' <para>
 4180    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4181    ''' </para>
 4182    ''' </remarks>
 44183    Public Sub Log(
 44184            ByVal message As String,
 44185            ByVal eventType As EventLogEntryType,
 44186            ByVal eventID As Integer,
 44187            ByVal category As Short,
 44188            ByVal maxKilobytes As Integer,
 44189            ByVal retentionDays As Integer,
 44190            ByVal writeInitEntry As Boolean)
 4191
 84192        Log(
 84193            message,
 84194            eventType,
 84195            eventID,
 84196            category,
 84197            Nothing,
 84198            maxKilobytes,
 84199            retentionDays,
 84200            writeInitEntry)
 4201
 84202    End Sub
 4203
 4204    ''' <summary>
 4205    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4206    ''' </summary>
 4207    ''' <param name="message">
 4208    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4209    '''
 4210    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4211    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4212    '''
 4213    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4214    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4215    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4216    ''' </param>
 4217    ''' <param name="eventType">
 4218    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4219    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4220    ''' </param>
 4221    ''' <param name="eventID">
 4222    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4223    ''' </param>
 4224    ''' <param name="category">
 4225    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4226    ''' </param>
 4227    ''' <param name="maxKilobytes">
 4228    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4229    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4230    ''' </param>
 4231    ''' <param name="retentionDays">
 4232    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4233    ''' Only used when creating a new log.
 4234    ''' </param>
 4235    ''' <param name="writeInitEntry">
 4236    ''' Indicates whether an initialization entry should be written when a new log is created.
 4237    ''' </param>
 4238    ''' <param name="EntrySeverity">
 4239    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4240    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4241    ''' will be skipped and not written to the Event Log.
 4242    ''' </param>
 4243    ''' <remarks>
 4244    ''' <para>
 4245    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4246    ''' </para>
 4247    ''' <para>
 4248    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4249    ''' </para>
 4250    ''' </remarks>
 44251    Public Sub Log(
 44252            ByVal message As String,
 44253            ByVal eventType As EventLogEntryType,
 44254            ByVal eventID As Integer,
 44255            ByVal category As Short,
 44256            ByVal maxKilobytes As Integer,
 44257            ByVal retentionDays As Integer,
 44258            ByVal writeInitEntry As Boolean,
 44259            ByVal EntrySeverity As LoggingSeverity)
 4260
 84261        Log(
 84262            message,
 84263            eventType,
 84264            eventID,
 84265            category,
 84266            Nothing,
 84267            maxKilobytes,
 84268            retentionDays,
 84269            writeInitEntry,
 84270            EntrySeverity)
 4271
 84272    End Sub
 4273
 4274    ''' <summary>
 4275    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4276    ''' </summary>
 4277    ''' <param name="message">
 4278    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4279    '''
 4280    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4281    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4282    '''
 4283    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4284    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4285    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4286    ''' </param>
 4287    ''' <param name="eventType">
 4288    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4289    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4290    ''' </param>
 4291    ''' <param name="eventID">
 4292    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4293    ''' </param>
 4294    ''' <param name="category">
 4295    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4296    ''' </param>
 4297    ''' <param name="rawData">
 4298    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4299    ''' </param>
 4300    ''' <param name="maxKilobytes">
 4301    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4302    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4303    ''' </param>
 4304    ''' <param name="retentionDays">
 4305    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4306    ''' Only used when creating a new log.
 4307    ''' </param>
 4308    ''' <param name="writeInitEntry">
 4309    ''' Indicates whether an initialization entry should be written when a new log is created.
 4310    ''' </param>
 4311    ''' <remarks>
 4312    ''' <para>
 4313    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4314    ''' </para>
 4315    ''' <para>
 4316    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4317    ''' </para>
 4318    ''' </remarks>
 44319    Public Sub Log(
 44320            ByVal message As String,
 44321            ByVal eventType As EventLogEntryType,
 44322            ByVal eventID As Integer,
 44323            ByVal category As Short,
 44324            ByVal rawData As Byte(),
 44325            ByVal maxKilobytes As Integer,
 44326            ByVal retentionDays As Integer,
 44327            ByVal writeInitEntry As Boolean)
 4328
 84329        Log(
 84330            "",
 84331            message,
 84332            eventType,
 84333            eventID,
 84334            category,
 84335            rawData,
 84336            maxKilobytes,
 84337            retentionDays,
 84338            writeInitEntry)
 4339
 84340    End Sub
 4341
 4342    ''' <summary>
 4343    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4344    ''' </summary>
 4345    ''' <param name="message">
 4346    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4347    '''
 4348    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4349    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4350    '''
 4351    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4352    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4353    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4354    ''' </param>
 4355    ''' <param name="eventType">
 4356    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4357    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4358    ''' </param>
 4359    ''' <param name="eventID">
 4360    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4361    ''' </param>
 4362    ''' <param name="category">
 4363    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4364    ''' </param>
 4365    ''' <param name="rawData">
 4366    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4367    ''' </param>
 4368    ''' <param name="maxKilobytes">
 4369    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4370    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4371    ''' </param>
 4372    ''' <param name="retentionDays">
 4373    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4374    ''' Only used when creating a new log.
 4375    ''' </param>
 4376    ''' <param name="writeInitEntry">
 4377    ''' Indicates whether an initialization entry should be written when a new log is created.
 4378    ''' </param>
 4379    ''' <param name="EntrySeverity">
 4380    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4381    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4382    ''' will be skipped and not written to the Event Log.
 4383    ''' </param>
 4384    ''' <remarks>
 4385    ''' <para>
 4386    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4387    ''' </para>
 4388    ''' <para>
 4389    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4390    ''' </para>
 4391    ''' </remarks>
 44392    Public Sub Log(
 44393            ByVal message As String,
 44394            ByVal eventType As EventLogEntryType,
 44395            ByVal eventID As Integer,
 44396            ByVal category As Short,
 44397            ByVal rawData As Byte(),
 44398            ByVal maxKilobytes As Integer,
 44399            ByVal retentionDays As Integer,
 44400            ByVal writeInitEntry As Boolean,
 44401            ByVal EntrySeverity As LoggingSeverity)
 4402
 84403        Log(
 84404            "",
 84405            message,
 84406            eventType,
 84407            eventID,
 84408            category,
 84409            rawData,
 84410            maxKilobytes,
 84411            retentionDays,
 84412            writeInitEntry,
 84413            EntrySeverity)
 4414
 84415    End Sub
 4416
 4417    ''' <summary>
 4418    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4419    ''' </summary>
 4420    ''' <param name="sourceName">
 4421    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 4422    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 4423    ''' </param>
 4424    ''' <param name="message">
 4425    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4426    '''
 4427    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4428    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4429    '''
 4430    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4431    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4432    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4433    ''' </param>
 4434    ''' <param name="eventType">
 4435    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4436    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4437    ''' </param>
 4438    ''' <param name="eventID">
 4439    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4440    ''' </param>
 4441    ''' <param name="category">
 4442    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4443    ''' </param>
 4444    ''' <param name="rawData">
 4445    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4446    ''' </param>
 4447    ''' <param name="maxKilobytes">
 4448    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4449    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4450    ''' </param>
 4451    ''' <param name="retentionDays">
 4452    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4453    ''' Only used when creating a new log.
 4454    ''' </param>
 4455    ''' <param name="writeInitEntry">
 4456    ''' Indicates whether an initialization entry should be written when a new log is created.
 4457    ''' </param>
 4458    ''' <remarks>
 4459    ''' <para>
 4460    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4461    ''' </para>
 4462    ''' <para>
 4463    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4464    ''' </para>
 4465    ''' </remarks>
 44466    Public Sub Log(
 44467            ByVal sourceName As String,
 44468            ByVal message As String,
 44469            ByVal eventType As EventLogEntryType,
 44470            ByVal eventID As Integer,
 44471            ByVal category As Short,
 44472            ByVal rawData As Byte(),
 44473            ByVal maxKilobytes As Integer,
 44474            ByVal retentionDays As Integer,
 44475            ByVal writeInitEntry As Boolean)
 4476
 84477        Log(
 84478            "",
 84479            sourceName,
 84480            message,
 84481            eventType,
 84482            eventID,
 84483            category,
 84484            rawData,
 84485            maxKilobytes,
 84486            retentionDays,
 84487            writeInitEntry)
 4488
 84489    End Sub
 4490
 4491    ''' <summary>
 4492    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4493    ''' </summary>
 4494    ''' <param name="sourceName">
 4495    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 4496    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 4497    ''' </param>
 4498    ''' <param name="message">
 4499    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4500    '''
 4501    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4502    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4503    '''
 4504    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4505    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4506    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4507    ''' </param>
 4508    ''' <param name="eventType">
 4509    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4510    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4511    ''' </param>
 4512    ''' <param name="eventID">
 4513    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4514    ''' </param>
 4515    ''' <param name="category">
 4516    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4517    ''' </param>
 4518    ''' <param name="rawData">
 4519    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4520    ''' </param>
 4521    ''' <param name="maxKilobytes">
 4522    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4523    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4524    ''' </param>
 4525    ''' <param name="retentionDays">
 4526    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4527    ''' Only used when creating a new log.
 4528    ''' </param>
 4529    ''' <param name="writeInitEntry">
 4530    ''' Indicates whether an initialization entry should be written when a new log is created.
 4531    ''' </param>
 4532    ''' <param name="EntrySeverity">
 4533    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4534    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4535    ''' will be skipped and not written to the Event Log.
 4536    ''' </param>
 4537    ''' <remarks>
 4538    ''' <para>
 4539    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4540    ''' </para>
 4541    ''' <para>
 4542    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4543    ''' </para>
 4544    ''' </remarks>
 44545    Public Sub Log(
 44546            ByVal sourceName As String,
 44547            ByVal message As String,
 44548            ByVal eventType As EventLogEntryType,
 44549            ByVal eventID As Integer,
 44550            ByVal category As Short,
 44551            ByVal rawData As Byte(),
 44552            ByVal maxKilobytes As Integer,
 44553            ByVal retentionDays As Integer,
 44554            ByVal writeInitEntry As Boolean,
 44555            ByVal EntrySeverity As LoggingSeverity)
 4556
 84557        Log(
 84558            "",
 84559            sourceName,
 84560            message,
 84561            eventType,
 84562            eventID,
 84563            category,
 84564            rawData,
 84565            maxKilobytes,
 84566            retentionDays,
 84567            writeInitEntry,
 84568            EntrySeverity)
 4569
 84570    End Sub
 4571
 4572    ''' <summary>
 4573    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4574    ''' </summary>
 4575    ''' <param name="logName">
 4576    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 4577    ''' If <c>null</c> or empty, "Application" is used by default.
 4578    ''' </param>
 4579    ''' <param name="sourceName">
 4580    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 4581    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 4582    ''' </param>
 4583    ''' <param name="message">
 4584    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4585    '''
 4586    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4587    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4588    '''
 4589    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4590    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4591    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4592    ''' </param>
 4593    ''' <param name="eventType">
 4594    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4595    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4596    ''' </param>
 4597    ''' <param name="eventID">
 4598    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4599    ''' </param>
 4600    ''' <param name="category">
 4601    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4602    ''' </param>
 4603    ''' <param name="rawData">
 4604    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4605    ''' </param>
 4606    ''' <param name="maxKilobytes">
 4607    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4608    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4609    ''' </param>
 4610    ''' <param name="retentionDays">
 4611    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4612    ''' Only used when creating a new log.
 4613    ''' </param>
 4614    ''' <param name="writeInitEntry">
 4615    ''' Indicates whether an initialization entry should be written when a new log is created.
 4616    ''' </param>
 4617    ''' <remarks>
 4618    ''' <para>
 4619    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4620    ''' </para>
 4621    ''' <para>
 4622    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4623    ''' </para>
 4624    ''' </remarks>
 44625    Public Sub Log(
 44626            ByVal logName As String,
 44627            ByVal sourceName As String,
 44628            ByVal message As String,
 44629            ByVal eventType As EventLogEntryType,
 44630            ByVal eventID As Integer,
 44631            ByVal category As Short,
 44632            ByVal rawData As Byte(),
 44633            ByVal maxKilobytes As Integer,
 44634            ByVal retentionDays As Integer,
 44635            ByVal writeInitEntry As Boolean)
 4636
 84637        Log(
 84638            "",
 84639            logName,
 84640            sourceName,
 84641            message,
 84642            eventType,
 84643            eventID,
 84644            category,
 84645            rawData,
 84646            maxKilobytes,
 84647            retentionDays,
 84648            writeInitEntry)
 4649
 84650    End Sub
 4651
 4652    ''' <summary>
 4653    ''' Writes an entry to the Windows Event Log using the provided parameters.
 4654    ''' </summary>
 4655    ''' <param name="logName">
 4656    ''' The name of the event log to write to (e.g., "Application", "System", or a custom log name).
 4657    ''' If <c>null</c> or empty, "Application" is used by default.
 4658    ''' </param>
 4659    ''' <param name="sourceName">
 4660    ''' The source of the log entry. If <c>null</c> or empty, a default source is generated using the calling method's
 4661    ''' namespace, class, and method name. If the source exceeds 254 characters, it is automatically truncated.
 4662    ''' </param>
 4663    ''' <param name="message">
 4664    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4665    '''
 4666    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4667    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4668    '''
 4669    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4670    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4671    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4672    ''' </param>
 4673    ''' <param name="eventType">
 4674    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4675    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4676    ''' </param>
 4677    ''' <param name="eventID">
 4678    ''' The numeric event identifier for the log entry. This is application-defined and may be used to group similar eve
 4679    ''' </param>
 4680    ''' <param name="category">
 4681    ''' The category for the event, if applicable. This is typically used in categorized event views.
 4682    ''' </param>
 4683    ''' <param name="rawData">
 4684    ''' Optional binary data to include with the log entry. Can be <c>null</c> if not used.
 4685    ''' </param>
 4686    ''' <param name="maxKilobytes">
 4687    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 4688    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 4689    ''' </param>
 4690    ''' <param name="retentionDays">
 4691    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 4692    ''' Only used when creating a new log.
 4693    ''' </param>
 4694    ''' <param name="writeInitEntry">
 4695    ''' Indicates whether an initialization entry should be written when a new log is created.
 4696    ''' </param>
 4697    ''' <param name="EntrySeverity">
 4698    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4699    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4700    ''' will be skipped and not written to the Event Log.
 4701    ''' </param>
 4702    ''' <remarks>
 4703    ''' <para>
 4704    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4705    ''' </para>
 4706    ''' <para>
 4707    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4708    ''' </para>
 4709    ''' </remarks>
 44710    Public Sub Log(
 44711            ByVal logName As String,
 44712            ByVal sourceName As String,
 44713            ByVal message As String,
 44714            ByVal eventType As EventLogEntryType,
 44715            ByVal eventID As Integer,
 44716            ByVal category As Short,
 44717            ByVal rawData As Byte(),
 44718            ByVal maxKilobytes As Integer,
 44719            ByVal retentionDays As Integer,
 44720            ByVal writeInitEntry As Boolean,
 44721            ByVal EntrySeverity As LoggingSeverity)
 4722
 84723        Log(
 84724            "",
 84725            logName,
 84726            sourceName,
 84727            message,
 84728            eventType,
 84729            eventID,
 84730            category,
 84731            rawData,
 84732            maxKilobytes,
 84733            retentionDays,
 84734            writeInitEntry,
 84735            EntrySeverity)
 4736
 84737    End Sub
 4738
 4739    ''' <summary>
 4740    ''' Writes an entry (or entries) to the Windows Event Log using the specified parameters.
 4741    ''' </summary>
 4742    ''' <param name="targetMachineName">
 4743    ''' The name of the machine where the event log resides. Use <c>"."</c> for the local machine.
 4744    ''' If <c>null</c> or empty, the local machine is used by default, or the value of the <see cref="MachineName"/> pro
 4745    ''' </param>
 4746    ''' <param name="targetLogName">
 4747    ''' The name of the event log (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 4748    ''' If <c>null</c> or empty, the value of the <see cref="LogName"/> property is used.
 4749    ''' </param>
 4750    ''' <param name="sourceName">
 4751    ''' The source name for the event entry. If <c>null</c> or empty, a source is auto-generated from the calling method
 4752    ''' If the resulting name exceeds 254 characters, it will be truncated.
 4753    ''' </param>
 4754    ''' <param name="message">
 4755    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4756    '''
 4757    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4758    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4759    '''
 4760    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4761    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4762    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4763    ''' </param>
 4764    ''' <param name="eventType">
 4765    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4766    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4767    ''' </param>
 4768    ''' <param name="eventID">
 4769    ''' The numeric event identifier. Application-defined and useful for grouping related events.
 4770    ''' </param>
 4771    ''' <param name="category">
 4772    ''' The category ID for the event. Use 0 if not applicable.
 4773    ''' </param>
 4774    ''' <param name="rawData">
 4775    ''' Optional binary data to associate with the event. Can be <c>null</c>.
 4776    ''' </param>
 4777    ''' <param name="maxKilobytes">
 4778    ''' The maximum size of the event log in kilobytes. Only applies when creating a new log. Range: 64 KB – 4 GB.
 4779    ''' </param>
 4780    ''' <param name="retentionDays">
 4781    ''' The number of days entries should be retained. 0 means entries are kept indefinitely.
 4782    ''' Applies only when creating a new log.
 4783    ''' </param>
 4784    ''' <param name="writeInitEntry">
 4785    ''' Whether to write an initialization entry when a new log is created.
 4786    ''' </param>
 4787    ''' <remarks>
 4788    ''' <para>
 4789    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4790    ''' </para>
 4791    ''' <para>
 4792    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4793    ''' </para>
 4794    ''' </remarks>
 804795    Public Sub Log(
 804796            ByVal targetMachineName As String,
 804797            ByVal targetLogName As String,
 804798            ByVal sourceName As String,
 804799            ByVal message As String,
 804800            ByVal eventType As EventLogEntryType,
 804801            ByVal eventID As Integer,
 804802            ByVal category As Short,
 804803            ByVal rawData As Byte(),
 804804            ByVal maxKilobytes As Integer,
 804805            ByVal retentionDays As Integer,
 804806            ByVal writeInitEntry As Boolean)
 4807
 1604808        Initialize()
 1604809        Log(
 1604810            targetMachineName,
 1604811            targetLogName,
 1604812            sourceName,
 1604813            message,
 1604814            eventType,
 1604815            eventID,
 1604816            category,
 1604817            rawData,
 1604818            maxKilobytes,
 1604819            retentionDays,
 1604820            writeInitEntry,
 1604821            LoggingSeverity)
 4822
 1604823    End Sub
 4824
 4825    ''' <summary>
 4826    ''' Writes an entry (or entries) to the Windows Event Log using the specified parameters.
 4827    ''' </summary>
 4828    ''' <param name="targetMachineName">
 4829    ''' The name of the machine where the event log resides. Use <c>"."</c> for the local machine.
 4830    ''' If <c>null</c> or empty, the local machine is used by default, or the value of the <see cref="MachineName"/> pro
 4831    ''' </param>
 4832    ''' <param name="targetLogName">
 4833    ''' The name of the event log (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 4834    ''' If <c>null</c> or empty, the value of the <see cref="LogName"/> property is used.
 4835    ''' </param>
 4836    ''' <param name="sourceName">
 4837    ''' The source name for the event entry. If <c>null</c> or empty, a source is auto-generated from the calling method
 4838    ''' If the resulting name exceeds 254 characters, it will be truncated.
 4839    ''' </param>
 4840    ''' <param name="message">
 4841    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4842    '''
 4843    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4844    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4845    '''
 4846    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4847    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4848    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4849    ''' </param>
 4850    ''' <param name="eventType">
 4851    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 4852    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 4853    ''' </param>
 4854    ''' <param name="eventID">
 4855    ''' The numeric event identifier. Application-defined and useful for grouping related events.
 4856    ''' </param>
 4857    ''' <param name="category">
 4858    ''' The category ID for the event. Use 0 if not applicable.
 4859    ''' </param>
 4860    ''' <param name="rawData">
 4861    ''' Optional binary data to associate with the event. Can be <c>null</c>.
 4862    ''' </param>
 4863    ''' <param name="maxKilobytes">
 4864    ''' The maximum size of the event log in kilobytes. Only applies when creating a new log. Range: 64 KB – 4 GB.
 4865    ''' </param>
 4866    ''' <param name="retentionDays">
 4867    ''' The number of days entries should be retained. 0 means entries are kept indefinitely.
 4868    ''' Applies only when creating a new log.
 4869    ''' </param>
 4870    ''' <param name="writeInitEntry">
 4871    ''' Whether to write an initialization entry when a new log is created.
 4872    ''' </param>
 4873    ''' <param name="EntrySeverity">
 4874    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4875    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4876    ''' will be skipped and not written to the Event Log.
 4877    ''' </param>
 4878    ''' <remarks>
 4879    ''' <para>
 4880    ''' If the specified event log or source does not exist, they are created automatically using the provided parameter
 4881    ''' </para>
 4882    ''' <para>
 4883    ''' This method handles safe formatting, validation, and optional message splitting to avoid truncation of diagnosti
 4884    ''' </para>
 4885    ''' </remarks>
 1724886    Public Sub Log(
 1724887            ByVal targetMachineName As String,
 1724888            ByVal targetLogName As String,
 1724889            ByVal sourceName As String,
 1724890            ByVal message As String,
 1724891            ByVal eventType As EventLogEntryType,
 1724892            ByVal eventID As Integer,
 1724893            ByVal category As Short,
 1724894            ByVal rawData As Byte(),
 1724895            ByVal maxKilobytes As Integer,
 1724896            ByVal retentionDays As Integer,
 1724897            ByVal writeInitEntry As Boolean,
 1724898            ByVal EntrySeverity As LoggingSeverity)
 4899
 3444900        Initialize()
 4901
 3484902        If EntrySeverity < CurrentLoggingLevel Then Exit Sub
 4903
 3364904        Dim defaultLog As String = If(String.IsNullOrEmpty(targetLogName), LogName, targetLogName.Trim())
 3364905        Dim defaultSource As String = Source(sourceName)
 3364906        Dim sourceToUse As String = defaultSource ' this is used to tell the process which source to actually use if we 
 3364907        Dim defaultMachine As String = NormalizeMachineName(targetMachineName)
 4908
 3364909        Dim finalEventType As EventLogEntryType = NormalizeEventType(eventType)
 4910
 3364911        If AllowMultiEntryMessages AndAlso message.Length > 32766 Then
 84912            For Each chunk As String In SplitMessageIntoPages(defaultSource, message)
 164913                _writer.WriteEntry(defaultMachine,
 164914                           defaultLog,
 164915                           sourceToUse,
 164916                           chunk,
 164917                           finalEventType,
 164918                           eventID,
 164919                           category,
 164920                           rawData,
 164921                           maxKilobytes,
 164922                           retentionDays,
 164923                           writeInitEntry)
 84924            Next
 1644925        Else
 3284926            _writer.WriteEntry(defaultMachine,
 3284927                               defaultLog,
 3284928                               sourceToUse,
 3284929                               NormalizeMessage(defaultSource, message),
 3284930                               finalEventType,
 3284931                               eventID,
 3284932                               category,
 3284933                               rawData,
 3284934                               maxKilobytes,
 3284935                               retentionDays,
 3284936                               writeInitEntry)
 1684937        End If
 4938
 3444939    End Sub
 4940
 4941#End Region
 4942
 4943#Region " Log Extension Methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 4944
 4945    ''' <summary>
 4946    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 4947    ''' </summary>
 4948    ''' <param name="eventLog">
 4949    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 4950    ''' with a valid log name and source.
 4951    ''' </param>
 4952    ''' <param name="message">
 4953    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4954    '''
 4955    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4956    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4957    '''
 4958    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4959    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4960    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4961    ''' </param>
 4962    ''' <remarks>
 4963    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 4964    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 4965    ''' to intercept and test log output without writing to the system Event Log.
 4966    ''' </remarks>
 4967    <Extension>
 44968    Public Sub LogEntry(
 44969            ByVal eventLog As EventLog,
 44970            ByVal message As String)
 4971
 84972        LogEntry(eventLog,
 84973                 message,
 84974                 EventLogEntryType.Information)
 4975
 84976    End Sub
 4977
 4978    ''' <summary>
 4979    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 4980    ''' </summary>
 4981    ''' <param name="eventLog">
 4982    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 4983    ''' with a valid log name and source.
 4984    ''' </param>
 4985    ''' <param name="message">
 4986    ''' The message to log. If <c>null</c> or empty, a default message is used.
 4987    '''
 4988    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 4989    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 4990    '''
 4991    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 4992    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 4993    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 4994    ''' </param>
 4995    ''' <param name="EntrySeverity">
 4996    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 4997    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 4998    ''' will be skipped and not written to the Event Log.
 4999    ''' </param>
 5000    ''' <remarks>
 5001    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5002    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5003    ''' to intercept and test log output without writing to the system Event Log.
 5004    ''' </remarks>
 5005    <Extension>
 205006    Public Sub LogEntry(
 205007            ByVal eventLog As EventLog,
 205008            ByVal message As String,
 205009            ByVal EntrySeverity As LoggingSeverity)
 5010
 405011        LogEntry(eventLog,
 405012                 message,
 405013                 EventLogEntryType.Information,
 405014                 EntrySeverity)
 5015
 405016    End Sub
 5017
 5018    ''' <summary>
 5019    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5020    ''' </summary>
 5021    ''' <param name="eventLog">
 5022    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5023    ''' with a valid log name and source.
 5024    ''' </param>
 5025    ''' <param name="message">
 5026    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5027    '''
 5028    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5029    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5030    '''
 5031    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5032    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5033    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5034    ''' </param>
 5035    ''' <param name="eventType">
 5036    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5037    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5038    ''' </param>
 5039    ''' <remarks>
 5040    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5041    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5042    ''' to intercept and test log output without writing to the system Event Log.
 5043    ''' </remarks>
 5044    <Extension>
 45045    Public Sub LogEntry(
 45046            ByVal eventLog As EventLog,
 45047            ByVal message As String,
 45048            ByVal eventType As EventLogEntryType)
 5049
 85050        LogEntry(eventLog,
 85051                 message,
 85052                 eventType,
 85053                 0)
 5054
 85055    End Sub
 5056
 5057    ''' <summary>
 5058    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5059    ''' </summary>
 5060    ''' <param name="eventLog">
 5061    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5062    ''' with a valid log name and source.
 5063    ''' </param>
 5064    ''' <param name="message">
 5065    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5066    '''
 5067    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5068    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5069    '''
 5070    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5071    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5072    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5073    ''' </param>
 5074    ''' <param name="eventType">
 5075    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5076    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5077    ''' </param>
 5078    ''' <param name="EntrySeverity">
 5079    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5080    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5081    ''' will be skipped and not written to the Event Log.
 5082    ''' </param>
 5083    ''' <remarks>
 5084    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5085    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5086    ''' to intercept and test log output without writing to the system Event Log.
 5087    ''' </remarks>
 5088    <Extension>
 205089    Public Sub LogEntry(
 205090            ByVal eventLog As EventLog,
 205091            ByVal message As String,
 205092            ByVal eventType As EventLogEntryType,
 205093            ByVal EntrySeverity As LoggingSeverity)
 5094
 405095        LogEntry(eventLog,
 405096                 message,
 405097                 eventType,
 405098                 0,
 405099                 EntrySeverity)
 5100
 405101    End Sub
 5102
 5103    ''' <summary>
 5104    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5105    ''' </summary>
 5106    ''' <param name="eventLog">
 5107    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5108    ''' with a valid log name and source.
 5109    ''' </param>
 5110    ''' <param name="message">
 5111    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5112    '''
 5113    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5114    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5115    '''
 5116    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5117    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5118    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5119    ''' </param>
 5120    ''' <param name="eventID">
 5121    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5122    ''' or filtering related log entries.
 5123    ''' </param>
 5124    ''' <remarks>
 5125    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5126    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5127    ''' to intercept and test log output without writing to the system Event Log.
 5128    ''' </remarks>
 5129    <Extension>
 45130    Public Sub LogEntry(
 45131            ByVal eventLog As EventLog,
 45132            ByVal message As String,
 45133            ByVal eventID As Integer)
 5134
 85135        LogEntry(eventLog,
 85136                 message,
 85137                 EventLogEntryType.Information,
 85138                 eventID)
 5139
 85140    End Sub
 5141
 5142    ''' <summary>
 5143    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5144    ''' </summary>
 5145    ''' <param name="eventLog">
 5146    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5147    ''' with a valid log name and source.
 5148    ''' </param>
 5149    ''' <param name="message">
 5150    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5151    '''
 5152    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5153    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5154    '''
 5155    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5156    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5157    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5158    ''' </param>
 5159    ''' <param name="eventID">
 5160    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5161    ''' or filtering related log entries.
 5162    ''' </param>
 5163    ''' <param name="EntrySeverity">
 5164    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5165    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5166    ''' will be skipped and not written to the Event Log.
 5167    ''' </param>
 5168    ''' <remarks>
 5169    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5170    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5171    ''' to intercept and test log output without writing to the system Event Log.
 5172    ''' </remarks>
 5173    <Extension>
 45174    Public Sub LogEntry(
 45175            ByVal eventLog As EventLog,
 45176            ByVal message As String,
 45177            ByVal eventID As Integer,
 45178            ByVal EntrySeverity As LoggingSeverity)
 5179
 85180        LogEntry(eventLog,
 85181                 message,
 85182                 EventLogEntryType.Information,
 85183                 eventID,
 85184                 EntrySeverity)
 5185
 85186    End Sub
 5187
 5188    ''' <summary>
 5189    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5190    ''' </summary>
 5191    ''' <param name="eventLog">
 5192    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5193    ''' with a valid log name and source.
 5194    ''' </param>
 5195    ''' <param name="message">
 5196    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5197    '''
 5198    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5199    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5200    '''
 5201    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5202    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5203    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5204    ''' </param>
 5205    ''' <param name="category">
 5206    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5207    ''' Use 0 if no category is needed.
 5208    ''' </param>
 5209    ''' <remarks>
 5210    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5211    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5212    ''' to intercept and test log output without writing to the system Event Log.
 5213    ''' </remarks>
 5214    <Extension>
 45215    Public Sub LogEntry(
 45216            ByVal eventLog As EventLog,
 45217            ByVal message As String,
 45218            ByVal category As Short)
 5219
 85220        LogEntry(eventLog,
 85221                 message,
 85222                 EventLogEntryType.Information,
 85223                 category)
 5224
 85225    End Sub
 5226
 5227    ''' <summary>
 5228    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5229    ''' </summary>
 5230    ''' <param name="eventLog">
 5231    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5232    ''' with a valid log name and source.
 5233    ''' </param>
 5234    ''' <param name="message">
 5235    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5236    '''
 5237    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5238    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5239    '''
 5240    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5241    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5242    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5243    ''' </param>
 5244    ''' <param name="category">
 5245    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5246    ''' Use 0 if no category is needed.
 5247    ''' </param>
 5248    ''' <param name="EntrySeverity">
 5249    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5250    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5251    ''' will be skipped and not written to the Event Log.
 5252    ''' </param>
 5253    ''' <remarks>
 5254    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5255    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5256    ''' to intercept and test log output without writing to the system Event Log.
 5257    ''' </remarks>
 5258    <Extension>
 45259    Public Sub LogEntry(
 45260            ByVal eventLog As EventLog,
 45261            ByVal message As String,
 45262            ByVal category As Short,
 45263            ByVal EntrySeverity As LoggingSeverity)
 5264
 85265        LogEntry(eventLog,
 85266                 message,
 85267                 EventLogEntryType.Information,
 85268                 category,
 85269                 EntrySeverity)
 5270
 85271    End Sub
 5272
 5273    ''' <summary>
 5274    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5275    ''' </summary>
 5276    ''' <param name="eventLog">
 5277    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5278    ''' with a valid log name and source.
 5279    ''' </param>
 5280    ''' <param name="message">
 5281    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5282    '''
 5283    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5284    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5285    '''
 5286    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5287    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5288    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5289    ''' </param>
 5290    ''' <param name="eventType">
 5291    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5292    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5293    ''' </param>
 5294    ''' <param name="eventID">
 5295    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5296    ''' or filtering related log entries.
 5297    ''' </param>
 5298    ''' <remarks>
 5299    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5300    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5301    ''' to intercept and test log output without writing to the system Event Log.
 5302    ''' </remarks>
 5303    <Extension>
 85304    Public Sub LogEntry(
 85305            ByVal eventLog As EventLog,
 85306            ByVal message As String,
 85307            ByVal eventType As EventLogEntryType,
 85308            ByVal eventID As Integer)
 5309
 165310        LogEntry(eventLog,
 165311                 message,
 165312                 eventType,
 165313                 eventID,
 165314                 0)
 5315
 165316    End Sub
 5317
 5318    ''' <summary>
 5319    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5320    ''' </summary>
 5321    ''' <param name="eventLog">
 5322    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5323    ''' with a valid log name and source.
 5324    ''' </param>
 5325    ''' <param name="message">
 5326    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5327    '''
 5328    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5329    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5330    '''
 5331    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5332    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5333    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5334    ''' </param>
 5335    ''' <param name="eventType">
 5336    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5337    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5338    ''' </param>
 5339    ''' <param name="eventID">
 5340    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5341    ''' or filtering related log entries.
 5342    ''' </param>
 5343    ''' <param name="EntrySeverity">
 5344    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5345    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5346    ''' will be skipped and not written to the Event Log.
 5347    ''' </param>
 5348    ''' <remarks>
 5349    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5350    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5351    ''' to intercept and test log output without writing to the system Event Log.
 5352    ''' </remarks>
 5353    <Extension>
 325354    Public Sub LogEntry(
 325355            ByVal eventLog As EventLog,
 325356            ByVal message As String,
 325357            ByVal eventType As EventLogEntryType,
 325358            ByVal eventID As Integer,
 325359            ByVal EntrySeverity As LoggingSeverity)
 5360
 645361        LogEntry(eventLog,
 645362                 message,
 645363                 eventType,
 645364                 eventID,
 645365                 0,
 645366                 EntrySeverity)
 5367
 645368    End Sub
 5369
 5370    ''' <summary>
 5371    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5372    ''' </summary>
 5373    ''' <param name="eventLog">
 5374    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5375    ''' with a valid log name and source.
 5376    ''' </param>
 5377    ''' <param name="message">
 5378    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5379    '''
 5380    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5381    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5382    '''
 5383    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5384    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5385    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5386    ''' </param>
 5387    ''' <param name="eventType">
 5388    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5389    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5390    ''' </param>
 5391    ''' <param name="category">
 5392    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5393    ''' Use 0 if no category is needed.
 5394    ''' </param>
 5395    ''' <remarks>
 5396    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5397    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5398    ''' to intercept and test log output without writing to the system Event Log.
 5399    ''' </remarks>
 5400    <Extension>
 45401    Public Sub LogEntry(
 45402            ByVal eventLog As EventLog,
 45403            ByVal message As String,
 45404            ByVal eventType As EventLogEntryType,
 45405            ByVal category As Short)
 5406
 85407        LogEntry(eventLog,
 85408                 message,
 85409                 eventType,
 85410                 0,
 85411                 category)
 5412
 85413    End Sub
 5414
 5415    ''' <summary>
 5416    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5417    ''' </summary>
 5418    ''' <param name="eventLog">
 5419    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5420    ''' with a valid log name and source.
 5421    ''' </param>
 5422    ''' <param name="message">
 5423    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5424    '''
 5425    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5426    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5427    '''
 5428    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5429    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5430    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5431    ''' </param>
 5432    ''' <param name="eventType">
 5433    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5434    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5435    ''' </param>
 5436    ''' <param name="category">
 5437    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5438    ''' Use 0 if no category is needed.
 5439    ''' </param>
 5440    ''' <param name="EntrySeverity">
 5441    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5442    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5443    ''' will be skipped and not written to the Event Log.
 5444    ''' </param>
 5445    ''' <remarks>
 5446    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5447    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5448    ''' to intercept and test log output without writing to the system Event Log.
 5449    ''' </remarks>
 5450    <Extension>
 45451    Public Sub LogEntry(
 45452            ByVal eventLog As EventLog,
 45453            ByVal message As String,
 45454            ByVal eventType As EventLogEntryType,
 45455            ByVal category As Short,
 45456            ByVal EntrySeverity As LoggingSeverity)
 5457
 85458        LogEntry(eventLog,
 85459                 message,
 85460                 eventType,
 85461                 0,
 85462                 category,
 85463                 EntrySeverity)
 5464
 85465    End Sub
 5466
 5467    ''' <summary>
 5468    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5469    ''' </summary>
 5470    ''' <param name="eventLog">
 5471    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5472    ''' with a valid log name and source.
 5473    ''' </param>
 5474    ''' <param name="message">
 5475    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5476    '''
 5477    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5478    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5479    '''
 5480    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5481    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5482    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5483    ''' </param>
 5484    ''' <param name="eventType">
 5485    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5486    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5487    ''' </param>
 5488    ''' <param name="eventID">
 5489    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5490    ''' or filtering related log entries.
 5491    ''' </param>
 5492    ''' <param name="category">
 5493    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5494    ''' Use 0 if no category is needed.
 5495    ''' </param>
 5496    ''' <remarks>
 5497    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5498    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5499    ''' to intercept and test log output without writing to the system Event Log.
 5500    ''' </remarks>
 5501    <Extension>
 45502    Public Sub LogEntry(
 45503            ByVal eventLog As EventLog,
 45504            ByVal message As String,
 45505            ByVal eventType As EventLogEntryType,
 45506            ByVal eventID As Integer,
 45507            ByVal category As Short)
 5508
 85509        LogEntry(eventLog,
 85510                 message,
 85511                 eventType,
 85512                 eventID,
 85513                 category,
 85514                 CType(Nothing, Byte()))
 5515
 85516    End Sub
 5517
 5518    ''' <summary>
 5519    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5520    ''' </summary>
 5521    ''' <param name="eventLog">
 5522    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5523    ''' with a valid log name and source.
 5524    ''' </param>
 5525    ''' <param name="message">
 5526    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5527    '''
 5528    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5529    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5530    '''
 5531    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5532    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5533    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5534    ''' </param>
 5535    ''' <param name="eventType">
 5536    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5537    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5538    ''' </param>
 5539    ''' <param name="eventID">
 5540    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5541    ''' or filtering related log entries.
 5542    ''' </param>
 5543    ''' <param name="category">
 5544    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5545    ''' Use 0 if no category is needed.
 5546    ''' </param>
 5547    ''' <param name="EntrySeverity">
 5548    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5549    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5550    ''' will be skipped and not written to the Event Log.
 5551    ''' </param>
 5552    ''' <remarks>
 5553    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5554    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5555    ''' to intercept and test log output without writing to the system Event Log.
 5556    ''' </remarks>
 5557    <Extension>
 365558    Public Sub LogEntry(
 365559            ByVal eventLog As EventLog,
 365560            ByVal message As String,
 365561            ByVal eventType As EventLogEntryType,
 365562            ByVal eventID As Integer,
 365563            ByVal category As Short,
 365564            ByVal EntrySeverity As LoggingSeverity)
 5565
 725566        LogEntry(eventLog,
 725567                 message,
 725568                 eventType,
 725569                 eventID,
 725570                 category,
 725571                 Nothing,
 725572                 EntrySeverity)
 5573
 725574    End Sub
 5575
 5576    ''' <summary>
 5577    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5578    ''' </summary>
 5579    ''' <param name="eventLog">
 5580    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5581    ''' with a valid log name and source.
 5582    ''' </param>
 5583    ''' <param name="message">
 5584    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5585    '''
 5586    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5587    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5588    '''
 5589    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5590    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5591    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5592    ''' </param>
 5593    ''' <param name="rawData">
 5594    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5595    ''' </param>
 5596    ''' <remarks>
 5597    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5598    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5599    ''' to intercept and test log output without writing to the system Event Log.
 5600    ''' </remarks>
 5601    <Extension>
 125602    Public Sub LogEntry(
 125603            ByVal eventLog As EventLog,
 125604            ByVal message As String,
 125605            ByVal rawData As Byte())
 5606
 245607        LogEntry(eventLog,
 245608                 message,
 245609                 EventLogEntryType.Information,
 245610                 rawData)
 5611
 245612    End Sub
 5613
 5614    ''' <summary>
 5615    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5616    ''' </summary>
 5617    ''' <param name="eventLog">
 5618    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5619    ''' with a valid log name and source.
 5620    ''' </param>
 5621    ''' <param name="message">
 5622    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5623    '''
 5624    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5625    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5626    '''
 5627    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5628    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5629    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5630    ''' </param>
 5631    ''' <param name="rawData">
 5632    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5633    ''' </param>
 5634    ''' <param name="EntrySeverity">
 5635    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5636    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5637    ''' will be skipped and not written to the Event Log.
 5638    ''' </param>
 5639    ''' <remarks>
 5640    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5641    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5642    ''' to intercept and test log output without writing to the system Event Log.
 5643    ''' </remarks>
 5644    <Extension>
 45645    Public Sub LogEntry(
 45646            ByVal eventLog As EventLog,
 45647            ByVal message As String,
 45648            ByVal rawData As Byte(),
 45649            ByVal EntrySeverity As LoggingSeverity)
 5650
 85651        LogEntry(eventLog,
 85652                 message,
 85653                 EventLogEntryType.Information,
 85654                 rawData,
 85655                 EntrySeverity)
 5656
 85657    End Sub
 5658
 5659    ''' <summary>
 5660    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5661    ''' </summary>
 5662    ''' <param name="eventLog">
 5663    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5664    ''' with a valid log name and source.
 5665    ''' </param>
 5666    ''' <param name="message">
 5667    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5668    '''
 5669    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5670    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5671    '''
 5672    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5673    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5674    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5675    ''' </param>
 5676    ''' <param name="eventType">
 5677    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5678    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5679    ''' </param>
 5680    ''' <param name="rawData">
 5681    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5682    ''' </param>
 5683    ''' <remarks>
 5684    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5685    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5686    ''' to intercept and test log output without writing to the system Event Log.
 5687    ''' </remarks>
 5688    <Extension>
 125689    Public Sub LogEntry(
 125690            ByVal eventLog As EventLog,
 125691            ByVal message As String,
 125692            ByVal eventType As EventLogEntryType,
 125693            ByVal rawData As Byte())
 5694
 245695        LogEntry(eventLog,
 245696                 message,
 245697                 eventType,
 245698                 0,
 245699                 rawData)
 5700
 245701    End Sub
 5702
 5703    ''' <summary>
 5704    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5705    ''' </summary>
 5706    ''' <param name="eventLog">
 5707    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5708    ''' with a valid log name and source.
 5709    ''' </param>
 5710    ''' <param name="message">
 5711    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5712    '''
 5713    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5714    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5715    '''
 5716    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5717    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5718    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5719    ''' </param>
 5720    ''' <param name="eventType">
 5721    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5722    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5723    ''' </param>
 5724    ''' <param name="rawData">
 5725    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5726    ''' </param>
 5727    ''' <param name="EntrySeverity">
 5728    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5729    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5730    ''' will be skipped and not written to the Event Log.
 5731    ''' </param>
 5732    ''' <remarks>
 5733    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5734    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5735    ''' to intercept and test log output without writing to the system Event Log.
 5736    ''' </remarks>
 5737    <Extension>
 45738    Public Sub LogEntry(
 45739            ByVal eventLog As EventLog,
 45740            ByVal message As String,
 45741            ByVal eventType As EventLogEntryType,
 45742            ByVal rawData As Byte(),
 45743            ByVal EntrySeverity As LoggingSeverity)
 5744
 85745        LogEntry(eventLog,
 85746                 message,
 85747                 eventType,
 85748                 0,
 85749                 rawData,
 85750                 EntrySeverity)
 5751
 85752    End Sub
 5753
 5754    ''' <summary>
 5755    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5756    ''' </summary>
 5757    ''' <param name="eventLog">
 5758    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5759    ''' with a valid log name and source.
 5760    ''' </param>
 5761    ''' <param name="message">
 5762    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5763    '''
 5764    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5765    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5766    '''
 5767    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5768    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5769    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5770    ''' </param>
 5771    ''' <param name="eventType">
 5772    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5773    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5774    ''' </param>
 5775    ''' <param name="eventID">
 5776    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5777    ''' or filtering related log entries.
 5778    ''' </param>
 5779    ''' <param name="rawData">
 5780    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5781    ''' </param>
 5782    ''' <remarks>
 5783    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5784    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5785    ''' to intercept and test log output without writing to the system Event Log.
 5786    ''' </remarks>
 5787    <Extension>
 125788    Public Sub LogEntry(
 125789            ByVal eventLog As EventLog,
 125790            ByVal message As String,
 125791            ByVal eventType As EventLogEntryType,
 125792            ByVal eventID As Integer,
 125793            ByVal rawData As Byte())
 5794
 245795        LogEntry(eventLog,
 245796                 message,
 245797                 eventType,
 245798                 eventID,
 245799                 0,
 245800                 rawData)
 5801
 245802    End Sub
 5803
 5804    ''' <summary>
 5805    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5806    ''' </summary>
 5807    ''' <param name="eventLog">
 5808    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5809    ''' with a valid log name and source.
 5810    ''' </param>
 5811    ''' <param name="message">
 5812    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5813    '''
 5814    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5815    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5816    '''
 5817    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5818    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5819    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5820    ''' </param>
 5821    ''' <param name="eventType">
 5822    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5823    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5824    ''' </param>
 5825    ''' <param name="eventID">
 5826    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5827    ''' or filtering related log entries.
 5828    ''' </param>
 5829    ''' <param name="rawData">
 5830    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5831    ''' </param>
 5832    ''' <param name="EntrySeverity">
 5833    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5834    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5835    ''' will be skipped and not written to the Event Log.
 5836    ''' </param>
 5837    ''' <remarks>
 5838    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5839    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5840    ''' to intercept and test log output without writing to the system Event Log.
 5841    ''' </remarks>
 5842    <Extension>
 45843    Public Sub LogEntry(
 45844            ByVal eventLog As EventLog,
 45845            ByVal message As String,
 45846            ByVal eventType As EventLogEntryType,
 45847            ByVal eventID As Integer,
 45848            ByVal rawData As Byte(),
 45849            ByVal EntrySeverity As LoggingSeverity)
 5850
 85851        LogEntry(eventLog,
 85852                 message,
 85853                 eventType,
 85854                 eventID,
 85855                 0,
 85856                 rawData,
 85857                 EntrySeverity)
 5858
 85859    End Sub
 5860
 5861    ''' <summary>
 5862    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5863    ''' </summary>
 5864    ''' <param name="eventLog">
 5865    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5866    ''' with a valid log name and source.
 5867    ''' </param>
 5868    ''' <param name="message">
 5869    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5870    '''
 5871    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5872    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5873    '''
 5874    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5875    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5876    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5877    ''' </param>
 5878    ''' <param name="eventType">
 5879    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5880    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5881    ''' </param>
 5882    ''' <param name="eventID">
 5883    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5884    ''' or filtering related log entries.
 5885    ''' </param>
 5886    ''' <param name="category">
 5887    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5888    ''' Use 0 if no category is needed.
 5889    ''' </param>
 5890    ''' <param name="rawData">
 5891    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5892    ''' </param>
 5893    ''' <remarks>
 5894    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5895    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5896    ''' to intercept and test log output without writing to the system Event Log.
 5897    ''' </remarks>
 5898    <Extension>
 205899    Public Sub LogEntry(
 205900            ByVal eventLog As EventLog,
 205901            ByVal message As String,
 205902            ByVal eventType As EventLogEntryType,
 205903            ByVal eventID As Integer,
 205904            ByVal category As Short,
 205905            ByVal rawData As Byte())
 5906
 405907        Initialize()
 405908        LogEntry(eventLog,
 405909                 message,
 405910                 eventType,
 405911                 eventID,
 405912                 category,
 405913                 rawData,
 405914                 LoggingSeverity)
 5915
 405916    End Sub
 5917
 5918    ''' <summary>
 5919    ''' Writes a log entry to the specified <see cref="EventLog"/> with the given parameters.
 5920    ''' </summary>
 5921    ''' <param name="eventLog">
 5922    ''' The <see cref="EventLog"/> instance to which the entry will be written. This must be properly initialized
 5923    ''' with a valid log name and source.
 5924    ''' </param>
 5925    ''' <param name="message">
 5926    ''' The message to log. If <c>null</c> or empty, a default message is used.
 5927    '''
 5928    ''' If <see cref="AllowMultiEntryMessages"/> is <c>false</c> (default), messages longer than 32,766 characters are t
 5929    ''' and suffixed with the <see cref="TruncationMarker"/> (e.g., <c>"... [TRUNCATED]"</c>).
 5930    '''
 5931    ''' If <see cref="AllowMultiEntryMessages"/> is <c>true</c>, long messages are split into multiple event entries,
 5932    ''' each prefixed with part information (e.g., <c>[Part 1/3]</c>) and intermediate entries are suffixed with
 5933    ''' the <see cref="ContinuationMarker"/> (e.g., <c>" ..."</c>) to indicate continuation.
 5934    ''' </param>
 5935    ''' <param name="eventType">
 5936    ''' The type of event. Valid values are <see cref="EventLogEntryType.Error"/>, <see cref="EventLogEntryType.Warning"
 5937    ''' <see cref="EventLogEntryType.Information"/>. If invalid, <c>Information</c> is used.
 5938    ''' </param>
 5939    ''' <param name="eventID">
 5940    ''' A numeric identifier for the event. This value is application-defined and can be used for categorizing
 5941    ''' or filtering related log entries.
 5942    ''' </param>
 5943    ''' <param name="category">
 5944    ''' A numeric category for the event. This is typically used in categorized views of the Event Log.
 5945    ''' Use 0 if no category is needed.
 5946    ''' </param>
 5947    ''' <param name="rawData">
 5948    ''' Optional binary data to associate with the log entry. This can be <c>null</c> if unused.
 5949    ''' </param>
 5950    ''' <param name="EntrySeverity">
 5951    ''' Indicates the importance or severity of this log entry relative to the configured logging threshold
 5952    ''' (<see cref="CurrentLoggingLevel"/>). If the severity is lower than the current logging level, the entry
 5953    ''' will be skipped and not written to the Event Log.
 5954    ''' </param>
 5955    ''' <remarks>
 5956    ''' This method uses configured or default values for formatting and fallbacks. The message is normalized
 5957    ''' and validated prior to writing. If you are using a test environment, an alternate writer can be configured
 5958    ''' to intercept and test log output without writing to the system Event Log.
 5959    ''' </remarks>
 5960    <Extension>
 605961    Public Sub LogEntry(
 605962            ByVal eventLog As EventLog,
 605963            ByVal message As String,
 605964            ByVal eventType As EventLogEntryType,
 605965            ByVal eventID As Integer,
 605966            ByVal category As Short,
 605967            ByVal rawData As Byte(),
 605968            ByVal EntrySeverity As LoggingSeverity)
 5969
 1205970        Initialize() ' By the time we get here, this should already be done, but just in case.
 5971
 1245972        If EntrySeverity < CurrentLoggingLevel Then Exit Sub
 5973
 1125974        Dim defaultSource As String = Source(eventLog.Source)
 1125975        Dim finalEventType As EventLogEntryType = NormalizeEventType(eventType)
 5976
 1125977        If AllowMultiEntryMessages AndAlso message.Length > 32766 Then
 165978            For Each chunk As String In SplitMessageIntoPages(defaultSource, message)
 325979                _writer.WriteEntry(eventLog,
 325980                           chunk,
 325981                           finalEventType,
 325982                           eventID,
 325983                           category,
 325984                           rawData)
 165985            Next
 485986        Else
 965987            _writer.WriteEntry(eventLog,
 965988                               NormalizeMessage(eventLog.Source, message),
 965989                               NormalizeEventType(eventType),
 965990                               eventID,
 965991                               category,
 965992                               rawData)
 565993        End If
 5994
 1205995    End Sub
 5996
 5997#End Region
 5998
 5999#Region " Support Functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 6000
 6001    ''' <summary>
 6002    ''' Returns a default event source name. If none is provided, this attempts to determine the calling
 6003    ''' method's fully qualified name as the source.
 6004    ''' </summary>
 6005    ''' <param name="eventSourceName">Optional. A specific source name to use. If null or empty, the calling method will
 6006    ''' <returns>A valid event source name derived from the input or calling method.</returns>
 4806007    Public Function Source(
 4806008            Optional ByVal eventSourceName As String = Nothing) As String
 6009
 6010        ' Final fallback if nothing else is available
 9606011        Dim strReturn As String = "SmartEventLogger"
 6012
 9606013        If String.IsNullOrEmpty(eventSourceName) Then
 2726014            If Not String.IsNullOrEmpty(SourceName) Then
 86015                strReturn = SourceName
 1326016            Else
 6017                ' Try to get the calling assembly (e.g., the one calling your library)
 2646018                Dim thisAssembly As Assembly = Assembly.GetExecutingAssembly()
 6019
 2646020                Dim stackTrace As New StackTrace()
 2646021                For i As Integer = 1 To stackTrace.FrameCount - 1
 20566022                    Dim frame As StackFrame = stackTrace.GetFrame(i)
 20566023                    Dim method As MethodBase = frame.GetMethod()
 20566024                    Dim type As Type = method.DeclaringType
 20566025                    If type.Assembly IsNot thisAssembly Then
 2646026                        strReturn = $"{type.FullName}.{method.Name}"
 2646027                        Exit For
 8966028                    End If
 17926029                Next
 1406030            End If
 3446031        Else
 6886032            strReturn = eventSourceName.Trim()
 4806033        End If
 6034
 6035        ' Ensure the source name does not exceed the maximum length allowed by the Windows Event Log system
 9606036        Return MaxSource(strReturn)
 6037
 9606038    End Function
 6039
 6040    ''' <summary>
 6041    ''' Attempts to determine a default source name for the given event log by inspecting the registry.
 6042    ''' </summary>
 6043    ''' <param name="log">The name of the event log (e.g., "Application", "System").</param>
 6044    ''' <returns>The name of a registered event source, or an empty string if none are found.</returns>
 46045    Public Function DefaultSource(
 46046            ByVal log As String) As String
 6047
 86048        Initialize()
 6049
 86050        Return DefaultSource(log, MachineName)
 6051
 86052    End Function
 6053
 6054    ''' <summary>
 6055    ''' Attempts to determine a default source name for the given event log by inspecting the registry.
 6056    ''' </summary>
 6057    ''' <param name="logName">The name of the event log (e.g., "Application", "System").</param>
 6058    ''' <param name="machineName">The target machine name, or "." for the local machine.</param>
 6059    ''' <returns>The name of a registered event source, or an empty string if none are found.</returns>
 46060    Public Function DefaultSource(
 46061            ByVal logName As String,
 46062            ByVal machineName As String) As String
 6063
 86064        Return _registryReader.GetDefaultEventLogSource(logName, machineName)
 6065
 86066    End Function
 6067
 6068    ''' <summary>
 6069    ''' Truncates the source name to meet the maximum length allowed by the Windows Event Log system.
 6070    ''' </summary>
 6071    ''' <param name="sourceName">The original source name.</param>
 6072    ''' <returns>A source name no longer than 211 characters.</returns>
 6073    ''' <remarks>
 6074    ''' If the input is null or empty, the method will derive a source name using the calling method.
 6075    ''' </remarks>
 5526076    Public Function MaxSource(
 5526077        ByVal sourceName As String) As String
 6078
 11046079        If String.IsNullOrEmpty(sourceName) Then
 166080            sourceName = Source()
 5606081        End If
 6082
 11046083        Return sourceName.Substring(0, If(sourceName.Length > 211, 211, sourceName.Length))
 6084
 11046085    End Function
 6086
 6087    ''' <summary>
 6088    ''' Checks whether a specific source is registered to a specific event log on the specified machine.
 6089    ''' </summary>
 6090    ''' <param name="sourceName">The name of the event source.</param>
 6091    ''' <param name="logName">The name of the event log (e.g., "Application").</param>
 6092    ''' <param name="machineName">The target machine name, or "." for the local machine.</param>
 6093    ''' <returns><c>True</c> if the source is registered; otherwise, <c>False</c>.</returns>
 46094    Public Function IsSourceRegisteredToLog(
 46095            ByVal sourceName As String,
 46096            ByVal logName As String,
 46097            ByVal machineName As String) As Boolean
 6098
 86099        Dim registryPath As String = $"SYSTEM\CurrentControlSet\Services\EventLog\{logName}\{sourceName}"
 6100
 86101        Return _registryReader.SubKeyExists(RegistryHive.LocalMachine, machineName, registryPath)
 6102
 86103    End Function
 6104
 6105    ''' <summary>
 6106    ''' Checks if the current user has read access to the registry key for a specific event log source.
 6107    ''' </summary>
 6108    ''' <param name="sourceName">The name of the event source.</param>
 6109    ''' <param name="logName">The name of the event log.</param>
 6110    ''' <param name="machineName">The machine to check, or "." for local machine.</param>
 6111    ''' <returns><c>True</c> if the registry key can be read; otherwise, <c>False</c>.</returns>
 46112    Public Function CanReadRegistryForLogAndSource(
 46113            ByVal sourceName As String,
 46114            ByVal logName As String,
 46115            ByVal machineName As String) As Boolean
 6116
 86117        Dim registryPath As String = $"SYSTEM\CurrentControlSet\Services\EventLog\{logName}\{sourceName}"
 6118
 86119        Return _registryReader.HasRegistryAccess(RegistryHive.LocalMachine, machineName, registryPath, False)
 6120
 86121    End Function
 6122
 6123    ''' <summary>
 6124    ''' Determines if the current user has access (read or write) to the registry key for a given event log.
 6125    ''' </summary>
 6126    ''' <param name="logName">The name of the event log.</param>
 6127    ''' <param name="machineName">The target machine name, or "." for local machine.</param>
 6128    ''' <param name="writeAccess">Optional. <c>True</c> to check for write access; otherwise, <c>False</c> for read-only
 6129    ''' <returns><c>True</c> if access is permitted; otherwise, <c>False</c>.</returns>
 46130    Public Function CanReadRegistryForLog(
 46131            ByVal logName As String,
 46132            ByVal machineName As String,
 46133            Optional ByVal writeAccess As Boolean = False) As Boolean
 6134
 86135        Dim registryPath As String = $"SYSTEM\CurrentControlSet\Services\EventLog\{logName}"
 6136
 86137        Return _registryReader.HasRegistryAccess(RegistryHive.LocalMachine, machineName, registryPath, writeAccess)
 6138
 86139    End Function
 6140
 6141    ''' <summary>
 6142    ''' Normalizes the message.
 6143    ''' </summary>
 6144    ''' <param name="sourceName">Name of the source.</param>
 6145    ''' <param name="message">The message.</param>
 6146    ''' <returns></returns>
 2126147    Private Function NormalizeMessage(
 2126148            ByVal sourceName As String,
 2126149            ByVal message As String) As String
 6150
 4246151        Dim defaultSource As String = Source(sourceName)
 4246152        Dim finalMessage As String = If(String.IsNullOrEmpty(message), "No message provided.", message.Trim())
 7926153        If Not finalMessage.EndsWith("."c, StringComparison.CurrentCultureIgnoreCase) Then finalMessage &= "."
 8406154        If _IncludeSourceInMessage AndAlso Not finalMessage.StartsWith("["c, StringComparison.CurrentCultureIgnoreCase) 
 6155
 6156        Const maxLength As Integer = 32766
 6157        Const _truncationMarker As String = "... [TRUNCATED]"
 4246158        Dim marker As String = If(String.IsNullOrEmpty(TruncationMarker), _truncationMarker, TruncationMarker)
 6159
 4246160        If finalMessage.Length > maxLength Then
 6161            ' Leave room for the truncation marker
 1046162            Dim maxWithoutMarker As Integer = maxLength - marker.Length
 1046163            finalMessage = $"{finalMessage.Substring(0, maxWithoutMarker)}{marker}"
 2646164        End If
 6165
 4246166        Return finalMessage
 6167
 4246168    End Function
 6169
 6170    ''' <summary>
 6171    ''' Splits the message into pages.
 6172    ''' </summary>
 6173    ''' <param name="sourceName">Name of the source.</param>
 6174    ''' <param name="message">The message.</param>
 6175    ''' <returns></returns>
 126176    Private Function SplitMessageIntoPages(
 126177        ByVal sourceName As String,
 126178        ByVal message As String) As IEnumerable(Of String)
 6179
 6180        Const maxLength As Integer = 32766
 246181        Dim defaultSource As String = Source(sourceName)
 246182        Dim baseMessage As String = message.Trim()
 486183        If Not baseMessage.EndsWith("."c, StringComparison.CurrentCultureIgnoreCase) Then baseMessage &= "."
 6184
 246185        Dim cm As String = ContinuationMarker
 6186
 326187        If String.IsNullOrEmpty(cm) Then cm = " ..."
 6188
 6189        ' Initial prefix length calculation
 6190        ' Format: "[Source] [Part 999/999] "
 246191        Dim maxPartsEstimate As Integer = CInt(Math.Ceiling(baseMessage.Length / (maxLength - 50)))
 246192        Dim digitCount As Integer = maxPartsEstimate.ToString(CultureInfo.InvariantCulture).Length + 1 ' pad by 1 digit 
 6193
 6194        ' Build conservative prefix sample with max digit placeholders
 246195        Dim maxPartsPlaceholder As New String("9"c, digitCount)
 6196        Dim prefixSample As String
 246197        If _IncludeSourceInMessage Then
 166198            prefixSample = $"[{defaultSource}] [Part {maxPartsPlaceholder}/{maxPartsPlaceholder}] "
 46199        Else
 86200            prefixSample = $"[Part {maxPartsPlaceholder}/{maxPartsPlaceholder}] "
 206201        End If
 6202        ' Calculate the chunk size by subtracting the prefix length and the space for " ..." at the end of a chunk
 246203        Dim chunkSize As Integer = maxLength - prefixSample.Length - cm.Length
 6204
 6205        ' Now split message
 246206        Dim parts As New List(Of String)
 246207        Dim index As Integer = 0
 726208        While index < baseMessage.Length
 486209            Dim len As Integer = Math.Min(chunkSize, baseMessage.Length - index)
 486210            parts.Add(baseMessage.Substring(index, len))
 486211            index += len
 246212        End While
 6213
 6214        ' Now wrap each chunk with prefix
 246215        Dim total As Integer = parts.Count
 246216        Dim result As New List(Of String)
 246217        For i As Integer = 0 To total - 2
 246218            If IncludeSourceInMessage Then
 166219                result.Add($"[{defaultSource}] [Part {i + 1}/{total}] {parts(i)}{cm}")
 46220            Else
 86221                result.Add($"[Part {i + 1}/{total}] {parts(i)}{cm}")
 206222            End If
 246223        Next
 246224        If IncludeSourceInMessage Then
 166225            result.Add($"[{defaultSource}] [Part {total}/{total}] {parts(total - 1)}")
 46226        Else
 86227            result.Add($"[Part {total}/{total}] {parts(total - 1)}")
 206228        End If
 6229
 246230        Return result
 6231
 246232    End Function
 6233
 6234    ''' <summary>
 6235    ''' Normalizes the type of the event.
 6236    ''' </summary>
 6237    ''' <param name="eventType">Type of the event.</param>
 6238    ''' <returns></returns>
 2726239    Private Function NormalizeEventType(
 2726240            ByVal eventType As EventLogEntryType) As EventLogEntryType
 6241
 5446242        Select Case eventType
 2286243            Case EventLogEntryType.Error, EventLogEntryType.Warning, EventLogEntryType.Information
 4566244                Return eventType
 446245            Case Else
 886246                Return EventLogEntryType.Information
 6247        End Select
 6248
 5446249    End Function
 6250
 6251    ''' <summary>
 6252    ''' Normalizes the name of the machine.
 6253    ''' </summary>
 6254    ''' <param name="_machineName">Name of the machine.</param>
 6255    ''' <returns></returns>
 2326256    Private Function NormalizeMachineName(
 2326257            ByVal _machineName As String) As String
 6258
 4646259        Return If(String.IsNullOrEmpty(_machineName), If(String.IsNullOrEmpty(MachineName), ".", MachineName), _machineN
 6260
 2406261    End Function
 6262
 6263#If NETFRAMEWORK Then
 6264    ''' <summary>
 6265    ''' Reads an application setting by key, returning <paramref name="defaultValue"/>
 6266    ''' when no setting is found or an error occurs.
 6267    ''' </summary>
 6268    ''' <param name="key">The configuration key to retrieve.</param>
 6269    ''' <param name="defaultValue">The fallback value if the key is missing or empty.</param>
 6270    ''' <remarks>
 6271    ''' <para>
 6272    ''' <b>.NET Framework:</b> Reads from <c>App.config</c> / <c>Web.config</c> using
 6273    ''' <see cref="ConfigurationManager.AppSettings"/>.
 6274    ''' </para>
 6275    ''' <para>
 6276    ''' If the key is not present or the value is empty, <paramref name="defaultValue"/> is returned.
 6277    ''' </para>
 6278    ''' </remarks>
 6279    ''' <returns>The resolved configuration value or the provided default.</returns>
 6280    Friend Function GetAppSetting(
 6281            ByVal key As String,
 6282            ByVal defaultValue As String) As String
 6283
 6284        Dim value As String = String.Empty
 6285        Try
 6286            ' .NET Framework: App.config / Web.config
 6287            value = ConfigurationManager.AppSettings(key)
 6288        Catch ex As Exception
 6289            value = defaultValue
 6290        End Try
 6291
 6292        If String.IsNullOrEmpty(value) Then
 6293            value = defaultValue
 6294        End If
 6295
 6296        Return value
 6297
 6298    End Function
 6299#Else
 6300    ''' <summary>
 6301    ''' Reads an application setting by key, returning <paramref name="defaultValue"/>
 6302    ''' when no setting is found or an error occurs.
 6303    ''' </summary>
 6304    ''' <param name="key">The configuration key to retrieve.</param>
 6305    ''' <param name="defaultValue">The fallback value if the key is missing or empty.</param>
 6306    ''' <remarks>
 6307    ''' <para>
 6308    ''' <b>.NET Core / .NET 5+:</b> If <c>appsettings.json</c> exists in <c>AppContext.BaseDirectory</c>,
 6309    ''' reads exclusively from it via <see cref="ConfigurationBuilder"/>.
 6310    ''' If the file does not exist, falls back to <c>App.config</c> / <c>Web.config</c> using
 6311    ''' <see cref="System.Configuration.ConfigurationManager.AppSettings"/>.
 6312    ''' </para>
 6313    ''' <para>
 6314    ''' If the key is not present or the value is empty, <paramref name="defaultValue"/> is returned.
 6315    ''' </para>
 6316    ''' </remarks>
 6317    ''' <returns>The resolved configuration value or the provided default.</returns>
 33046318    Friend Function GetAppSetting(
 33046319            ByVal key As String,
 33046320            ByVal defaultValue As String) As String
 6321
 66086322        Dim value As String = String.Empty
 6323        ' .NET Core / .NET 5+
 6324        '       If appsettings.json exists, ONLY use it (ignore App.config/Web.config completely).
 6325        '       If appsettings.json does not exist, fall back to App.config/Web.config.
 6326        '       Missing or empty keys in either case fall back to defaultValue.
 66086327        Dim jsonPath As String = Path.Combine(AppContext.BaseDirectory, JsonSettingsFile)
 66086328        If FileSystem.FileExists(jsonPath) Then
 32966329            Try
 65926330                Dim builder As New ConfigurationBuilder()
 65926331                builder.SetBasePath(AppContext.BaseDirectory)
 65926332                builder.AddJsonFile(JsonSettingsFile, optional:=True, reloadOnChange:=True)
 65926333                Dim cr As IConfigurationRoot = builder.Build()
 6334
 65846335                value = cr(key)
 46336            Catch ex As Exception
 86337                value = defaultValue
 32966338            End Try
 86339        Else
 86340            Try
 6341                ' App.config / Web.config
 166342                value = Config.GetAppSetting(key)
 46343            Catch ex As Exception
 86344                value = defaultValue
 86345            End Try
 33046346        End If
 6347
 66086348        If String.IsNullOrEmpty(value) Then
 40486349            value = defaultValue
 53286350        End If
 6351
 66086352        Return value
 6353
 66086354    End Function
 6355#End If
 6356
 6357    ''' <summary>
 6358    ''' Gets the application setting.
 6359    ''' </summary>
 6360    ''' <param name="key">The key.</param>
 6361    ''' <param name="defaultValue">The default value.</param>
 6362    ''' <returns></returns>
 5046363    Private Function GetAppSetting(
 5046364            ByVal key As String,
 5046365            ByVal defaultValue As Integer) As Integer
 6366
 10086367        Dim raw As String = GetAppSetting(key, defaultValue.ToString(CultureInfo.InvariantCulture))
 6368
 6369        Dim result As Integer
 10086370        Return If(Integer.TryParse(raw, result), result, defaultValue)
 6371
 7566372    End Function
 6373
 6374    ''' <summary>
 6375    ''' Gets the application setting.
 6376    ''' </summary>
 6377    ''' <param name="key">The key.</param>
 6378    ''' <param name="defaultValue">if set to <c>true</c> default value.</param>
 6379    ''' <returns></returns>
 7566380    Private Function GetAppSetting(
 7566381            ByVal key As String,
 7566382            ByVal defaultValue As Boolean) As Boolean
 6383
 15126384        Dim raw As String = GetAppSetting(key, defaultValue.ToString())
 6385
 6386        Dim result As Boolean
 15126387        Return If(Boolean.TryParse(raw, result), result, defaultValue)
 6388
 12606389    End Function
 6390
 6391    ''' <summary>
 6392    ''' Gets the application setting.
 6393    ''' </summary>
 6394    ''' <typeparam name="TEnum">The type of the enum.</typeparam>
 6395    ''' <param name="key">The key.</param>
 6396    ''' <param name="defaultValue">The default value.</param>
 6397    ''' <returns></returns>
 6398    ''' <exception cref="ArgumentException">{NameOf(TEnum)} must be an Enum type.</exception>
 7726399    Friend Function GetAppSetting(Of TEnum As Structure)(
 7726400            ByVal key As String,
 7726401            ByVal defaultValue As TEnum) As TEnum
 6402
 6403        ' Make sure TEnum is actually an Enum
 15446404        If Not GetType(TEnum).IsEnum Then
 86405            Throw New ArgumentException($"{NameOf(TEnum)} must be an Enum type.")
 7686406        End If
 6407
 15366408        Dim rawValue As String = GetAppSetting(key, CType(Nothing, String))
 15366409        If String.IsNullOrEmpty(rawValue) Then
 15126410            Return defaultValue
 126411        End If
 6412
 126413        Try
 6414            ' Use Enum.Parse for .NET 3.5 compatibility
 6415#If NETFRAMEWORK Then
 6416            Dim parsedObj As Object = [Enum].Parse(GetType(TEnum), rawValue, True)
 6417#Else
 246418            Dim parsedObj As Object = [Enum].Parse(Of TEnum)(rawValue, True)
 6419#End If
 86420            Return CType(parsedObj, TEnum)
 46421        Catch ex As ArgumentException
 6422            ' Value not valid for the enum
 86423            Return defaultValue
 46424        Catch ex As OverflowException
 6425            ' In case of underlying type overflow
 86426            Return defaultValue
 6427        End Try
 6428
 15366429    End Function
 6430
 6431#End Region
 6432
 6433#Region " GetLog routines ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
 6434
 6435    ''' <summary>
 6436    ''' Gets the entry log class to use for writing to the event log.
 6437    ''' </summary>
 6438    ''' <returns></returns>
 46439    Public Function GetLog() As EventLog
 6440
 86441        Initialize()
 6442
 86443        Return GetLog(
 86444            SourceName)
 6445
 86446    End Function
 6447
 6448    ''' <summary>
 6449    ''' Gets the entry log class to use for writing to the event log.
 6450    ''' </summary>
 6451    ''' <param name="sourceName">
 6452    ''' The source name to associate with the event log entry. If <c>null</c> or empty, a source is automatically
 6453    ''' generated using the calling method's namespace, class, and method name.
 6454    ''' If the source exceeds 254 characters, it is automatically truncated.
 6455    ''' </param>
 6456    ''' <returns></returns>
 46457    Public Function GetLog(
 46458            ByVal sourceName As String) As EventLog
 6459
 86460        Initialize()
 6461
 86462        Return GetLog(
 86463            LogName,
 86464            sourceName)
 6465
 86466    End Function
 6467
 6468    ''' <summary>
 6469    ''' Gets the entry log class to use for writing to the event log.
 6470    ''' </summary>
 6471    ''' <param name="logName">
 6472    ''' The name of the event log to write to (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 6473    ''' If <c>null</c> or empty, the value of the static <c>LogName</c> property is used.
 6474    ''' </param>
 6475    ''' <param name="sourceName">
 6476    ''' The source name to associate with the event log entry. If <c>null</c> or empty, a source is automatically
 6477    ''' generated using the calling method's namespace, class, and method name.
 6478    ''' If the source exceeds 254 characters, it is automatically truncated.
 6479    ''' </param>
 6480    ''' <returns></returns>
 646481    Public Function GetLog(
 646482            ByVal logName As String,
 646483            ByVal sourceName As String) As EventLog
 6484
 1286485        Initialize()
 6486
 1286487        Return GetLog(
 1286488            logName,
 1286489            sourceName,
 1286490            MaxKilobytes,
 1286491            RetentionDays)
 6492
 1286493    End Function
 6494
 6495    ''' <summary>
 6496    ''' Gets the entry log class to use for writing to the event log.
 6497    ''' </summary>
 6498    ''' <param name="logName">
 6499    ''' The name of the event log to write to (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 6500    ''' If <c>null</c> or empty, the value of the static <c>LogName</c> property is used.
 6501    ''' </param>
 6502    ''' <param name="sourceName">
 6503    ''' The source name to associate with the event log entry. If <c>null</c> or empty, a source is automatically
 6504    ''' generated using the calling method's namespace, class, and method name.
 6505    ''' If the source exceeds 254 characters, it is automatically truncated.
 6506    ''' </param>
 6507    ''' <param name="maxKilobytes">
 6508    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 6509    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 6510    ''' </param>
 6511    ''' <param name="retentionDays">
 6512    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 6513    ''' Only used when creating a new log.
 6514    ''' </param>
 6515    ''' <returns></returns>
 646516    Public Function GetLog(
 646517            ByVal logName As String,
 646518            ByVal sourceName As String,
 646519            ByVal maxKilobytes As Integer,
 646520            ByVal retentionDays As Integer) As EventLog
 6521
 1286522        Initialize()
 6523
 1286524        Return GetLog(
 1286525            logName,
 1286526            sourceName,
 1286527            maxKilobytes,
 1286528            retentionDays,
 1286529            WriteInitEntry)
 6530
 1286531    End Function
 6532
 6533    ''' <summary>
 6534    ''' Gets the entry log class to use for writing to the event log.
 6535    ''' </summary>
 6536    ''' <param name="logName">
 6537    ''' The name of the event log to write to (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 6538    ''' If <c>null</c> or empty, the value of the static <c>LogName</c> property is used.
 6539    ''' </param>
 6540    ''' <param name="sourceName">
 6541    ''' The source name to associate with the event log entry. If <c>null</c> or empty, a source is automatically
 6542    ''' generated using the calling method's namespace, class, and method name.
 6543    ''' If the source exceeds 254 characters, it is automatically truncated.
 6544    ''' </param>
 6545    ''' <param name="maxKilobytes">
 6546    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 6547    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 6548    ''' </param>
 6549    ''' <param name="retentionDays">
 6550    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 6551    ''' Only used when creating a new log.
 6552    ''' </param>
 6553    ''' <param name="writeInitEntry">
 6554    ''' Indicates whether an initialization entry should be written when a new log is created.
 6555    ''' </param>
 6556    ''' <returns></returns>
 646557    Public Function GetLog(
 646558            ByVal logName As String,
 646559            ByVal sourceName As String,
 646560            ByVal maxKilobytes As Integer,
 646561            ByVal retentionDays As Integer,
 646562            ByVal writeInitEntry As Boolean) As EventLog
 6563
 1286564        Initialize()
 6565
 1286566        Return GetLog(
 1286567            MachineName,
 1286568            logName,
 1286569            sourceName,
 1286570            maxKilobytes,
 1286571            retentionDays,
 1286572            writeInitEntry)
 6573
 1286574    End Function
 6575
 6576    ''' <summary>
 6577    ''' Gets the entry log class to use for writing to the event log.
 6578    ''' </summary>
 6579    ''' <param name="machineName">
 6580    ''' The name of the machine where the event log resides. Use <c>"."</c> to refer to the local machine.
 6581    ''' If <c>null</c> or empty, the local machine is used by default, or the value in <c>MachinName</c> if set.
 6582    ''' </param>
 6583    ''' <param name="logName">
 6584    ''' The name of the event log to write to (e.g., <c>"Application"</c>, <c>"System"</c>, or a custom log name).
 6585    ''' If <c>null</c> or empty, the value of the static <c>LogName</c> property is used.
 6586    ''' </param>
 6587    ''' <param name="sourceName">
 6588    ''' The source name to associate with the event log entry. If <c>null</c> or empty, a source is automatically
 6589    ''' generated using the calling method's namespace, class, and method name.
 6590    ''' If the source exceeds 254 characters, it is automatically truncated.
 6591    ''' </param>
 6592    ''' <param name="maxKilobytes">
 6593    ''' The maximum size of the event log in kilobytes. Only used when creating a new log.
 6594    ''' Must be between 64 KB and 4 GB. If 0 or negative, the system default is used.
 6595    ''' </param>
 6596    ''' <param name="retentionDays">
 6597    ''' The number of days to retain event log entries. If 0, events are retained indefinitely.
 6598    ''' Only used when creating a new log.
 6599    ''' </param>
 6600    ''' <param name="writeInitEntry">
 6601    ''' Indicates whether an initialization entry should be written when a new log is created.
 6602    ''' </param>
 6603    ''' <returns></returns>
 646604    Public Function GetLog(
 646605            ByVal machineName As String,
 646606            ByVal logName As String,
 646607            ByVal sourceName As String,
 646608            ByVal maxKilobytes As Integer,
 646609            ByVal retentionDays As Integer,
 646610            ByVal writeInitEntry As Boolean) As EventLog
 6611
 1286612        Initialize()
 6613
 1286614        Return _writer.GetLog(
 1286615            NormalizeMachineName(machineName),
 1286616            logName,
 1286617            sourceName,
 1286618            maxKilobytes,
 1286619            retentionDays,
 1286620            writeInitEntry)
 6621
 1286622    End Function
 6623
 6624#End Region
 6625
 6626End Module

Methods/Properties

.cctor()
SetWriter(EventLogHelper.Interfaces.IEventLogWriter)
SetWriter(EventLogHelper.Interfaces.IEventLogWriter)
SetRegistryReader(EventLogHelper.Interfaces.IRegistryReader)
SetRegistryReader(EventLogHelper.Interfaces.IRegistryReader)
Initialize()
Initialize()
InitializeConfiguration()
InitializeConfiguration()
Reset()
Reset()
get_MachineName()
get_MachineName()
set_MachineName(System.String)
set_MachineName(System.String)
get_LogName()
get_LogName()
set_LogName(System.String)
set_LogName(System.String)
get_SourceName()
get_SourceName()
set_SourceName(System.String)
set_SourceName(System.String)
get_MaxKilobytes()
get_MaxKilobytes()
set_MaxKilobytes(System.Int32)
set_MaxKilobytes(System.Int32)
get_RetentionDays()
get_RetentionDays()
set_RetentionDays(System.Int32)
set_RetentionDays(System.Int32)
get_WriteInitEntry()
get_WriteInitEntry()
set_WriteInitEntry(System.Boolean)
set_WriteInitEntry(System.Boolean)
get_TruncationMarker()
get_TruncationMarker()
set_TruncationMarker(System.String)
set_TruncationMarker(System.String)
get_ContinuationMarker()
get_ContinuationMarker()
set_ContinuationMarker(System.String)
set_ContinuationMarker(System.String)
get_AllowMultiEntryMessages()
get_AllowMultiEntryMessages()
set_AllowMultiEntryMessages(System.Boolean)
set_AllowMultiEntryMessages(System.Boolean)
get_IsInitialized()
get_IsInitialized()
get_IncludeSourceInMessage()
get_IncludeSourceInMessage()
set_IncludeSourceInMessage(System.Boolean)
set_IncludeSourceInMessage(System.Boolean)
get_CurrentLoggingLevel()
get_CurrentLoggingLevel()
set_CurrentLoggingLevel(EventLogHelper.Enums.LoggingLevel)
set_CurrentLoggingLevel(EventLogHelper.Enums.LoggingLevel)
get_LoggingSeverity()
get_LoggingSeverity()
set_LoggingSeverity(EventLogHelper.Enums.LoggingSeverity)
set_LoggingSeverity(EventLogHelper.Enums.LoggingSeverity)
get_SourceResolutionBehavior()
get_SourceResolutionBehavior()
set_SourceResolutionBehavior(EventLogHelper.Enums.SourceResolutionBehavior)
set_SourceResolutionBehavior(EventLogHelper.Enums.SourceResolutionBehavior)
Log(System.String)
Log(System.String)
Log(System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String)
Log(System.String,System.String)
Log(System.String,System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String)
Log(System.String,System.String,System.String)
Log(System.String,System.String,System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Byte[])
Log(System.String,System.Byte[])
Log(System.String,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Int32,System.Int32)
Log(System.String,System.Int32,System.Int32)
Log(System.String,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
Log(System.String,System.String,System.String,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],System.Int32,System.Int32,System.Boolean,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String)
LogEntry(System.Diagnostics.EventLog,System.String)
LogEntry(System.Diagnostics.EventLog,System.String,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int32)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int32)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int32,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int32,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[])
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
LogEntry(System.Diagnostics.EventLog,System.String,System.Diagnostics.EventLogEntryType,System.Int32,System.Int16,System.Byte[],EventLogHelper.Enums.LoggingSeverity)
Source(System.String)
Source(System.String)
DefaultSource(System.String)
DefaultSource(System.String)
DefaultSource(System.String,System.String)
DefaultSource(System.String,System.String)
MaxSource(System.String)
MaxSource(System.String)
IsSourceRegisteredToLog(System.String,System.String,System.String)
IsSourceRegisteredToLog(System.String,System.String,System.String)
CanReadRegistryForLogAndSource(System.String,System.String,System.String)
CanReadRegistryForLogAndSource(System.String,System.String,System.String)
CanReadRegistryForLog(System.String,System.String,System.Boolean)
CanReadRegistryForLog(System.String,System.String,System.Boolean)
NormalizeMessage(System.String,System.String)
NormalizeMessage(System.String,System.String)
SplitMessageIntoPages(System.String,System.String)
SplitMessageIntoPages(System.String,System.String)
NormalizeEventType(System.Diagnostics.EventLogEntryType)
NormalizeEventType(System.Diagnostics.EventLogEntryType)
NormalizeMachineName(System.String)
NormalizeMachineName(System.String)
GetAppSetting(System.String,System.String)
GetAppSetting(System.String,System.String)
GetAppSetting(System.String,System.Int32)
GetAppSetting(System.String,System.Int32)
GetAppSetting(System.String,System.Boolean)
GetAppSetting(System.String,System.Boolean)
GetAppSetting(System.String,TEnum)
GetAppSetting(System.String,TEnum)
GetLog()
GetLog()
GetLog(System.String)
GetLog(System.String)
GetLog(System.String,System.String)
GetLog(System.String,System.String)
GetLog(System.String,System.String,System.Int32,System.Int32)
GetLog(System.String,System.String,System.Int32,System.Int32)
GetLog(System.String,System.String,System.Int32,System.Int32,System.Boolean)
GetLog(System.String,System.String,System.Int32,System.Int32,System.Boolean)
GetLog(System.String,System.String,System.String,System.Int32,System.Int32,System.Boolean)
GetLog(System.String,System.String,System.String,System.Int32,System.Int32,System.Boolean)