diff --git a/src/Microsoft.Azure.SignalR.Common/ServiceConnections/ServiceConnectionContainerBase.cs b/src/Microsoft.Azure.SignalR.Common/ServiceConnections/ServiceConnectionContainerBase.cs index 4a333ae2f..bbe5857da 100644 --- a/src/Microsoft.Azure.SignalR.Common/ServiceConnections/ServiceConnectionContainerBase.cs +++ b/src/Microsoft.Azure.SignalR.Common/ServiceConnections/ServiceConnectionContainerBase.cs @@ -758,7 +758,7 @@ private static class Log LoggerMessage.Define(LogLevel.Information, new EventId(1, "EndpointOnline"), "Hub '{hub}' is now connected to '{endpoint}'."); private static readonly Action _endpointOffline = - LoggerMessage.Define(LogLevel.Error, new EventId(2, "EndpointOffline"), "Hub '{hub}' is now disconnected from '{endpoint}'. Please check log for detailed info."); + LoggerMessage.Define(LogLevel.Warning, new EventId(2, "EndpointOffline"), "Hub '{hub}' is now disconnected from '{endpoint}'. Please check log for detailed info."); private static readonly Action _receivedFinAckPing = LoggerMessage.Define(LogLevel.Information, new EventId(3, "ReceivedFinAckPing"), "Received FinAck ping."); diff --git a/test/Microsoft.Azure.SignalR.Tests/RunSignalRTests.cs b/test/Microsoft.Azure.SignalR.Tests/RunSignalRTests.cs index 6962062d1..9211428f9 100644 --- a/test/Microsoft.Azure.SignalR.Tests/RunSignalRTests.cs +++ b/test/Microsoft.Azure.SignalR.Tests/RunSignalRTests.cs @@ -69,7 +69,7 @@ public async Task TestRunSignalRWithSimpleHub() Assert.NotNull(connectionDisconnectLog); Assert.Equal("conn1 disconnected: .", connectionDisconnectLog.Write.Message); - Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning)); + Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning && s.Write.EventId.Name != "EndpointOffline").Select(s => s.Write.EventId.Name)); } [Fact] @@ -108,7 +108,8 @@ public async Task TestRunSignalRWithSimpleHubAndMultipleConnections() Assert.Equal(0, logs.Count(s => s.Write.EventId.Name == "DetectedLongRunningApplicationTask")); Assert.Equal(count, logs.Count(s => s.Write.LoggerName == typeof(SimpleHub).FullName)); - Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning)); + + Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning && s.Write.EventId.Name != "EndpointOffline").Select(s => s.Write.EventId.Name)); } [Fact] @@ -146,7 +147,7 @@ public async Task TestRunSignalRWithConnectedSendingMessages() var connectionDisconnectLog = logs.FirstOrDefault(s => s.Write.LoggerName == typeof(ConnectedHub).FullName); Assert.NotNull(connectionDisconnectLog); Assert.Equal("conn1 disconnected: .", connectionDisconnectLog.Write.Message); - Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning && s.Write.EventId.Name != "DetectedLongRunningApplicationTask").Select(s => s.Write.EventId.Name)); + Assert.Empty(logs.Where(s => s.Write.LogLevel == LogLevel.Warning && s.Write.EventId.Name != "DetectedLongRunningApplicationTask" && s.Write.EventId.Name != "EndpointOffline").Select(s => s.Write.EventId.Name)); } private sealed class TestStartup : IStartup