nblumhardt/serilog-sinks-browserhttp

Error : Received failed result NotFound when posting events to the server

nssidhu opened this issue · 3 comments

I have created hosted blazorwasm project and trying to utilize serilog to view the log and events

I am getting the following Error

'2021-06-06T07:16:11.1970000Z Exception while emitting periodic batch from Serilog.Sinks.BrowserHttp.BrowserHttpSink:
Serilog.Debugging.LoggingFailedException: Received failed result NotFound when posting events to the server.\n at Serilog.Sinks.BrowserHttp.BrowserHttpSink.EmitBatchAsync(IEnumerable`1 events)\n
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()'

Here is my configuration code in blazor wasm client.

 var levelSwitch = new LoggingLevelSwitch();
            Log.Logger = new LoggerConfiguration()
                .MinimumLevel.ControlledBy(levelSwitch)
                .Enrich.FromLogContext()
                .WriteTo.BrowserHttp($"{builder.HostEnvironment.BaseAddress}ingest", controlLevelSwitch: levelSwitch)
                .CreateLogger();

Also when i navigate to https://localhost:5001/ingest, it shows blank web page.

Hi @nssidhu - are you running something like Serilog.AspNetCore.Ingestion on the server-side?

Hmm 🤔 - no ideas then, sorry. Checking the browser's network tab for the failing request might shed some light on it. Good luck!