Azure / azure-signalr

Azure SignalR Service SDK for .NET
https://aka.ms/signalr-service
MIT License
427 stars 101 forks source link

Control log level of _endpointOffline log line #2093

Open bodamgaard opened 1 day ago

bodamgaard commented 1 day ago

Is your feature request related to a problem? Please describe.

When making rolling deployments (i.e. in pod rotations in Kubernetes), we are seeing the following error in our logs:

Hub '{hub}' is now disconnected from '{endpoint}'. Please check log for detailed info.

We're treating logs of Error level as scenarios, where something is really wrong and something that developers needs to pay attention to immediately - and in this case, we don't have any control over the level of this log line because it's set up within ServiceConnectionContainerBase.cs

Ideally, we'd like to have it only as a warning since we know that it does happen when making a rolling deployment.

Describe the solution you'd like

Either:

Additional context

We've configured Azure SignalR to gracefully shutdown and migrate client connections, like so:

builder.Services.AddSignalR()
        .AddAzureSignalR(option =>
        {            
            option.GracefulShutdown.Mode = GracefulShutdownMode.MigrateClients;
            option.GracefulShutdown.Timeout = TimeSpan.FromSeconds(30);
        })

We're using Serilog to handle the logging for us.