Set LogLevel of Blazor

7/12/2026
1 minute read

Blazor is a bit talkative when it comes to the Developer Console. PageSpeed Insights for example does complain:

Browser errors were logged to the console

The fix is easy.

Setup logging in Blazor.start

The default template scaffolds something like that:

<script src="_framework/blazor.web.js">

But we can easily configure this manually:

<script>
    Blazor.start({
        logLevel: "none",
        circuit: {
            configureSignalR: builder => {
                builder.configureLogging("none");
            }
        }
    });
</script>

This would stop any logging whatsoever. A better version might be ti use critical instead of none. More can be found here: https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/logging?view=aspnetcore-10.0#signalr-client-logging-with-the-signalr-client-builder

An error has occurred. This application may no longer respond until reloaded.Reload x