We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic functional test failing on PS 5.1, but works with PS 7.3. Other tested serilog.sinks (File, Console) function as expected.
Error seems to be centered around this line:
serilog-sinks-eventlog/src/Serilog.Sinks.EventLog/LoggerConfigurationEventLogExtensions.cs
Line 70 in dac4ef3
Failed case with PowerShell 5.1 .NET Foundation 4.8.1:
PS C:\> $serilog = Add-Type -Path "C:\Program Files\WindowsPowerShell\Modules\PoShLog\2.1.1\lib\Serilog.dll" -PassThru PS C:\> $serilogEventLog = Add-Type -Path "C:\Program Files\WindowsPowerShell\Modules\PoShLog.Sinks.EventLog\1.0.0\lib\Serilog.Sinks.Eventlog.dll" -PassThru PS C:\> $config = New-Object Serilog.LoggerConfiguration PS C:\> [Serilog.LoggerConfigurationEventLogExtensions]::EventLog($Config.WriteTo,'Application') Exception calling "EventLog" with "2" argument(s): "EventLog access is not supported on this platform." At line:1 char:1 + [Serilog.LoggerConfigurationEventLogExtensions]::EventLog($Config.Wri ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : PlatformNotSupportedException PS C:\> $PSVersionTable Name Value ---- ----- PSVersion 5.1.19041.3031 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.3031 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Passed case with PowerShell 7.3.4 .NET 7:
PS C:\> $serilog = Add-Type -Path "C:\Program Files\WindowsPowerShell\Modules\PoShLog\2.1.1\lib\Serilog.dll" -PassThru PS C:\> $serilogEventLog = Add-Type -Path "C:\Program Files\WindowsPowerShell\Modules\PoShLog.Sinks.EventLog\1.0.0\lib\Serilog.Sinks.Eventlog.dll" -PassThru PS C:\> $config = New-Object Serilog.LoggerConfiguration PS C:\> [Serilog.LoggerConfigurationEventLogExtensions]::EventLog($Config.WriteTo,'Application') WriteTo : Serilog.Configuration.LoggerSinkConfiguration AuditTo : Serilog.Configuration.LoggerAuditSinkConfiguration MinimumLevel : Serilog.Configuration.LoggerMinimumLevelConfiguration Enrich : Serilog.Configuration.LoggerEnrichmentConfiguration Filter : Serilog.Configuration.LoggerFilterConfiguration Destructure : Serilog.Configuration.LoggerDestructuringConfiguration ReadFrom : Serilog.Configuration.LoggerSettingsConfiguration PS C:\> $PSVersionTable Name Value ---- ----- PSVersion 7.3.4 PSEdition Core GitCommitId 7.3.4 OS Microsoft Windows 10.0.19045 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Basic functional test failing on PS 5.1, but works with PS 7.3. Other tested serilog.sinks (File, Console) function as expected.
Error seems to be centered around this line:
serilog-sinks-eventlog/src/Serilog.Sinks.EventLog/LoggerConfigurationEventLogExtensions.cs
Line 70 in dac4ef3
Failed case with PowerShell 5.1 .NET Foundation 4.8.1:
Passed case with PowerShell 7.3.4 .NET 7:
The text was updated successfully, but these errors were encountered: