Hello,
I Would use the standard .NET ILogger.
injecting ILogger in your components and configuring it at application startup, you can centrally manage logging via configuration in an easy way.
You're talking about logging the errors in a database table, which is fine, but think where to log the errors in case the logging dataabase isn't there.
Maybe make a difference between system errors (like logging database unavailable) and application errors (that are being logged in your database).
This article describes nicely how to implement logging:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-6.0
and this article describes how to apply this in Blazor:
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/logging?view=aspnetcore-6.0
Have fun,
Cheers,
Willem
Hi,@Cenk ,
you can try to refer to
ErrorBoundary
in the offcial doc.If you want to handle global exception,you can try to create a CustomErrorBoundary (inherit the ErrorBoundary) and overrideOnErrorAsync(Exception exception)
,you can also log errors in it.