Skip to content

Commit 3d093fd

Browse files
committed
Log shutdown errors to EventSource logger
1 parent a808498 commit 3d093fd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ public AuthMechanismFactory AuthMechanismFactory(IList<string> mechanismNames)
352352
/// </exception>
353353
public virtual IConnection CreateConnection()
354354
{
355-
ESLog.Info("CreateConnection");
356355
return CreateConnection(this.EndpointResolverFactory(LocalEndpoints()), null);
357356
}
358357

projects/client/RabbitMQ.Client/src/client/impl/Connection.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,12 @@ public void HandleMainLoopException(ShutdownEventArgs reason)
563563
if (!SetCloseReason(reason))
564564
{
565565
LogCloseError("Unexpected Main Loop Exception while closing: "
566-
+ reason, null);
566+
+ reason, new Exception(reason.ToString()));
567567
return;
568568
}
569569

570570
OnShutdown();
571-
LogCloseError("Unexpected connection closure: " + reason, null);
571+
LogCloseError("Unexpected connection closure: " + reason, new Exception(reason.ToString()));
572572
}
573573

574574
public bool HardProtocolExceptionHandler(HardProtocolException hpe)
@@ -616,6 +616,7 @@ public void InternalClose(ShutdownEventArgs reason)
616616

617617
public void LogCloseError(String error, Exception ex)
618618
{
619+
ESLog.Error(error, ex);
619620
m_shutdownReport.Add(new ShutdownReportEntry(error, ex));
620621
}
621622

@@ -1049,6 +1050,7 @@ public void HeartbeatReadTimerCallback(object state)
10491050
{
10501051
String description = String.Format("Heartbeat missing with heartbeat == {0} seconds", m_heartbeat);
10511052
var eose = new EndOfStreamException(description);
1053+
ESLog.Error(description, eose);
10521054
m_shutdownReport.Add(new ShutdownReportEntry(description, eose));
10531055
HandleMainLoopException(
10541056
new ShutdownEventArgs(ShutdownInitiator.Library, 0, "End of stream", eose));

0 commit comments

Comments
 (0)