serilog-sinks-azureblobstorage
serilog-sinks-azureblobstorage copied to clipboard
Call to log writer never returns in Blazor application (from Issue #32)
Hi,
A problem was raised at the end of Issue #32, which was closed because it initially concerned only pre-.NET Standard 2.0 applications. The very same problem arises in Blazor applications. The application stops reading logs after the first line read, and it then loads endlessly. Help would be greatly appreciated.
I can't foresee a time when I'd have the availability to debug into what's happening with Blazor applications. I'm sorry it's not working for you, but given that there is source available here, please post what you find when look into it.
More to the point, it's super easy to submit a pull request, so I'd urge you to consider that.
Thanks for the quick reply Chris. I totally understand what you're saying. No worries at all.
Just a quick clarification if you don't mind. You wrote "I'm sorry it's not working for you". To your knowledge, does the Sink work on Blazor for other people?
Unfortunately I've never heard of any feedback, one way or the other, from Blazor developers.
Got it thanks. Not sure I'll find the time to work on this myself. If someone else out there can find the time, that would be great. In the meantime, I'll just use the File Sink.
Out of the box, it does not work for me in .Net 6 w/ Blazor Server. It seems to interfere with either Microsoft.Identity.Web or SignalR. The sink will write some data to the blob but the Blazor application just sits and spins.
Removing the reference to WriteTo.AzureBlobStorage and the application works just fine...
Using the Install-Package Serilog.Sinks.Async resolves the issue:
.WriteTo.Async(a=> a.AzureBlobStorage(
"<<connectionstring>>",
Serilog.Events.LogEventLevel.Information,
"logs",
"{yyyy}/{MM}/{dd}/{yyyy}-{MM}-{dd}_{HH}.txt"
))
I have the same problem. .NET 8 Blazor Server It seems to occur when writeInBatches is set to false. When it is set to true, I haven't tested it much yet, but so far, it appears to be working correctly.
I don't think I have any plans on testing in the Blazor environment, so closing for now