-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
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
Upgrading to 5.2 from 5.1 breaks use in Blazor WebAssembly #184
Comments
Hi @vincentnl, Thanks for the report. This issue occurs because Blazor WASM doesn't use the .NET HttpClient, but instead wraps the browsers fetch API. Use of HttpClient features that can't be mapped to fetch result in exceptions. It is probable that 5.2 will work with net6.0 if you are able to target that. |
Dear Liam,
Thank you for the quick feedback. I’m aware that I submit a poorly documented issue, with low reproducibility and context information.
As I’m well served with downgrading to 5.1, my issue is resolved, for now.
As to your suggestion, I’m already targeting .net 6.0, so not sure if that is the solution.
|
Thanks @vincentnl, |
Hi @vincentnl - |
On .NET 6.0.10 Blazor WASM I get this using v5.2.1:
The line in question is: loggerConfig.WriteTo.Seq(serverUrl: seq.ServerUrl, apiKey: seq.ApiKey, controlLevelSwitch: levelSwitch); |
Hi @hellfirehd , I think you might need the more recent 5.2.1-dev-00245 . |
As to your request, I've updated to 5.2.1-dev-00247 - Support on Blazor Wasm is not yet working.
|
I'll take another look - thanks for checking it out, everyone :-) |
Sorry, just in case you beat me to it - |
I've tested with 5.2.2-dev-00247. Sorry to report that it has not been resolved.
My configuration is still the same:
|
Thanks for checking it out again @vincentnl . I've had another attempt and verified with a sample project in: I'll let you know here as soon as there's a published build available. Thanks again! |
Downgrading fixed the issue.
The Chrome console reports:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Net.Http.SocketsHttpHandler.set_PooledConnectionLifetime(TimeSpan value)
at Serilog.Sinks.Seq.Http.SeqIngestionApiClient..ctor(String serverUrl, String apiKey, HttpMessageHandler messageHandler)
at Serilog.SeqLoggerConfigurationExtensions.Seq(LoggerSinkConfiguration loggerSinkConfiguration, String serverUrl, LogEventLevel restrictedToMinimumLevel, Int32 batchPostingLimit, Nullable
1 period, String apiKey, String bufferBaseFilename, Nullable
1 bufferSizeLimitBytes, Nullable1 eventBodyLimitBytes, LoggingLevelSwitch controlLevelSwitch, HttpMessageHandler messageHandler, Nullable
1 retainedInvalidPayloadsLimitBytes, Int32 queueSizeLimit)Log.Logger = new LoggerConfiguration() .MinimumLevel.Override("Microsoft", LogEventLevel.Information) .Enrich.FromLogContext() .Enrich.WithProperty("Domain", "PersonalFinance") .Enrich.WithProperty("App", "Web") //.WriteTo.BrowserConsole() // this one causes Json errors (null value) //.WriteTo.Debug() .WriteTo.Seq("http://****.org:5341") .CreateLogger();
The text was updated successfully, but these errors were encountered: