added LogId to options and use it to create logging scope

This commit is contained in:
Jan Eggers
2017-10-27 12:29:13 +02:00
parent 3a250723d7
commit dd447f24d2
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ namespace MQTTnet.Core.Client
_adapter = _communicationAdapterFactory.CreateClientMqttCommunicationAdapter(options);
_scopeHandle = _logger.BeginScope(options.ClientId);
_scopeHandle = _logger.BeginScope(options.LogId ?? options.ClientId);
_logger.LogTrace("Trying to connect with server.");
await _adapter.ConnectAsync(_options.CommunicationTimeout).ConfigureAwait(false);
_logger.LogTrace("Connection with server established.");