Align different formats of log messages.

This commit is contained in:
Christian
2020-11-16 20:47:44 +01:00
parent f9c3014e52
commit a93f44217b
14 changed files with 35 additions and 34 deletions
@@ -453,7 +453,7 @@ namespace MQTTnet.Server
}
}
_logger.Verbose("Queued application message sent (ClientId: {0}).", ClientId);
_logger.Verbose("Client '{0}': Queued application message sent.", ClientId);
}
}
catch (Exception exception)
@@ -463,15 +463,15 @@ namespace MQTTnet.Server
}
else if (exception is MqttCommunicationTimedOutException)
{
_logger.Warning(exception, "Sending publish packet failed: Timeout (ClientId: {0}).", ClientId);
_logger.Warning(exception, "Client '{0}': Sending publish packet failed: Timeout.", ClientId);
}
else if (exception is MqttCommunicationException)
{
_logger.Warning(exception, "Sending publish packet failed: Communication exception (ClientId: {0}).", ClientId);
_logger.Warning(exception, "Client '{0}': Sending publish packet failed: Communication exception.", ClientId);
}
else
{
_logger.Error(exception, "Sending publish packet failed (ClientId: {0}).", ClientId);
_logger.Error(exception, "Client '{0}': Sending publish packet failed.", ClientId);
}
if (publishPacket?.QualityOfServiceLevel > MqttQualityOfServiceLevel.AtMostOnce)
+1 -1
View File
@@ -54,7 +54,7 @@ namespace MQTTnet.Server
return false;
}
_logger.Verbose("Queued application message with topic '{0}' (ClientId: {1}).", applicationMessage.Topic, ClientId);
_logger.Verbose("Client '{0}': Queued application message with topic '{1}'.", ClientId, applicationMessage.Topic);
ApplicationMessagesQueue.Enqueue(applicationMessage, senderClientId, checkSubscriptionsResult.QualityOfServiceLevel, isRetainedApplicationMessage);
@@ -67,20 +67,21 @@ namespace MQTTnet.Server
if (connectPacket == null)
{
_logger.Warning(null,
"The first packet from client '{0}' was no 'CONNECT' packet [MQTT-3.1.0-1].",
"Client '{0}': First received packet was no 'CONNECT' packet [MQTT-3.1.0-1].",
channelAdapter.Endpoint);
return;
}
}
}
catch (OperationCanceledException)
{
_logger.Warning(null, "Client '{0}' connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
_logger.Warning(null, "Client '{0}': Connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
return;
}
catch (MqttCommunicationTimedOutException)
{
_logger.Warning(null, "Client '{0}' connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
_logger.Warning(null, "Client '{0}': Connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
return;
}