Skip to content

Instantly share code, notes, and snippets.

@NooNameR
Created September 9, 2019 10:38
Show Gist options
  • Select an option

  • Save NooNameR/80ca3d21104ed00248292ebab23ee79f to your computer and use it in GitHub Desktop.

Select an option

Save NooNameR/80ca3d21104ed00248292ebab23ee79f to your computer and use it in GitHub Desktop.
Index: src/MassTransit/EnabledDiagnosticSource.cs
===================================================================
--- src/MassTransit/EnabledDiagnosticSource.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/EnabledDiagnosticSource.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
@@ -1,24 +0,0 @@
-namespace MassTransit
-{
- using System.Diagnostics;
-
-
- public readonly struct EnabledDiagnosticSource
- {
- readonly DiagnosticSource _source;
- readonly string _name;
-
- public EnabledDiagnosticSource(DiagnosticSource source, string name)
- {
- _source = source;
- _name = name;
- }
-
- public StartedActivity? StartActivity(object args = null)
- {
- Activity activity = new Activity(_name);
-
- return new StartedActivity(_source, _source.StartActivity(activity, args));
- }
- }
-}
Index: src/MassTransit/StartedActivity.cs
===================================================================
--- src/MassTransit/StartedActivity.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/StartedActivity.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
@@ -1,22 +0,0 @@
-namespace MassTransit
-{
- using System.Diagnostics;
-
-
- public readonly struct StartedActivity
- {
- public readonly DiagnosticSource Source;
- public readonly Activity Activity;
-
- public StartedActivity(DiagnosticSource source, Activity activity)
- {
- Source = source;
- Activity = activity;
- }
-
- public void Stop(object args = default)
- {
- Source.StopActivity(Activity, args);
- }
- }
-}
Index: src/MassTransit/Transports/BaseHost.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Transports/BaseHost.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Transports/BaseHost.cs (date 1568023295537)
@@ -88,7 +88,7 @@
if (_handle != null)
throw new MassTransitException($"The host was already started: {_hostConfiguration.HostAddress}");
- LogContext.Debug?.Log("Starting host: {HostAddress}", _hostConfiguration.HostAddress);
+ LogContext.LogDebug("Starting host: {HostAddress}", _hostConfiguration.HostAddress);
DefaultLogContext = LogContext.Current;
SendLogContext = LogContext.Current.CreateLogContext(LogCategoryName.Transport.Send);
Index: src/Persistence/MassTransit.MongoDbIntegration/MessageData/MongoDbMessageDataRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MongoDbIntegration/MessageData/MongoDbMessageDataRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MongoDbIntegration/MessageData/MongoDbMessageDataRepository.cs (date 1568023295617)
@@ -51,7 +51,7 @@
var id = await _bucket.UploadFromStreamAsync(filename, stream, options, cancellationToken)
.ConfigureAwait(false);
- LogContext.Debug?.Log("MessageData:Put {Id} {FileName}", id, filename);
+ LogContext.LogDebug("MessageData:Put {Id} {FileName}", id, filename);
return _resolver.GetAddress(id);
}
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/MessageReceiverFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/MessageReceiverFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/MessageReceiverFilter.cs (date 1568023295158)
@@ -44,7 +44,7 @@
async Task IFilter<ClientContext>.Send(ClientContext context, IPipe<ClientContext> next)
{
- LogContext.Debug?.Log("Creating message receiver for {InputAddress}", context.InputAddress);
+ LogContext.LogDebug("Creating message receiver for {InputAddress}", context.InputAddress);
var receiver = CreateMessageReceiver(context, _messageReceiver);
@@ -66,7 +66,7 @@
await _transportObserver.Completed(new ReceiveTransportCompletedEvent(context.InputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", context.InputAddress,
+ LogContext.LogDebug("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", context.InputAddress,
metrics.DeliveryCount, metrics.ConcurrentDeliveryCount);
}
Index: src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimiter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimiter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimiter.cs (date 1568023405867)
@@ -69,11 +69,11 @@
context.Message.ConcurrencyLimit
}).ConfigureAwait(false);
- LogContext.Debug?.Log("Set Consumer Limit: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit, context.Message.Id);
+ LogContext.LogDebug("Set Consumer Limit: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit, context.Message.Id);
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Set Consumer Limit failed: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit,
+ LogContext.LogError(exception, "Set Consumer Limit failed: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit,
context.Message.Id);
throw;
Index: src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimitFilterManagementConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimitFilterManagementConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Pipeline/Filters/ConcurrencyLimit/ConcurrencyLimitFilterManagementConsumer.cs (date 1568023405860)
@@ -57,11 +57,11 @@
context.Message.ConcurrencyLimit
}).ConfigureAwait(false);
- LogContext.Debug?.Log("Set Consumer Limit: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit, context.Message.Id);
+ LogContext.LogDebug("Set Consumer Limit: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit, context.Message.Id);
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Set Consumer Limit failed: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit,
+ LogContext.LogError(exception, "Set Consumer Limit failed: {ConcurrencyLimit} ({CommandId})", context.Message.ConcurrencyLimit,
context.Message.Id);
throw;
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/ConfigureTopologyFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/ConfigureTopologyFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/ConfigureTopologyFilter.cs (date 1568023394847)
@@ -57,7 +57,7 @@
}
catch (Exception ex)
{
- LogContext.Warning?.Log(ex, "Failed to remove one or more subscriptions from the endpoint.");
+ LogContext.LogWarning(ex, "Failed to remove one or more subscriptions from the endpoint.");
}
});
}).ConfigureAwait(false);
Index: src/MassTransit/Configuration/SagaExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/SagaExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/SagaExtensions.cs (date 1568023295167)
@@ -29,7 +29,7 @@
if (sagaRepository == null)
throw new ArgumentNullException(nameof(sagaRepository));
- LogContext.Debug?.Log("Subscribing Saga: {SagaType}", TypeMetadataCache<T>.ShortName);
+ LogContext.LogDebug("Subscribing Saga: {SagaType}", TypeMetadataCache<T>.ShortName);
var sagaConfigurator = new SagaConfigurator<T>(sagaRepository, configurator);
@@ -54,7 +54,7 @@
if (sagaRepository == null)
throw new ArgumentNullException(nameof(sagaRepository));
- LogContext.Debug?.Log("Connecting Saga: {SagaType}", TypeMetadataCache<T>.ShortName);
+ LogContext.LogDebug("Connecting Saga: {SagaType}", TypeMetadataCache<T>.ShortName);
ISagaSpecification<T> specification = SagaConnectorCache<T>.Connector.CreateSagaSpecification<T>();
foreach (IPipeSpecification<SagaConsumeContext<T>> pipeSpecification in pipeSpecifications)
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/MessagingFactoryContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/MessagingFactoryContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/MessagingFactoryContextFactory.cs (date 1568023406071)
@@ -92,7 +92,7 @@
messagingFactory.RetryPolicy = _retryPolicy;
- LogContext.Debug?.Log("Connected: {Host}", _serviceUri);
+ LogContext.LogDebug("Connected: {Host}", _serviceUri);
var messagingFactoryContext = new ServiceBusMessagingFactoryContext(messagingFactory, supervisor.Stopped);
@@ -100,7 +100,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Connect failed: {Host}", _serviceUri);
+ LogContext.LogError(ex, "Connect failed: {Host}", _serviceUri);
throw;
}
Index: src/Persistence/MassTransit.DocumentDbIntegration/Saga/DocumentDbSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.DocumentDbIntegration/Saga/DocumentDbSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.DocumentDbIntegration/Saga/DocumentDbSagaRepository.cs (date 1568023406010)
@@ -177,13 +177,13 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
}
@@ -198,14 +198,14 @@
await _client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(_databaseName, _collectionName), instance, _requestOptions, true)
.ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
return JsonConvert.DeserializeObject<TSaga>(response.Resource.ToString(), _jsonSerializerSettings);
}
catch (Exception ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
@@ -217,7 +217,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
SagaConsumeContext<TSaga, T> sagaConsumeContext =
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/NamespaceContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/NamespaceContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/NamespaceContextFactory.cs (date 1568023406050)
@@ -85,7 +85,7 @@
if (supervisor.Stopping.IsCancellationRequested)
throw new OperationCanceledException($"The namespace is stopping and cannot be used: {_serviceUri}");
- LogContext.Debug?.Log("Created NamespaceManager: {ServiceUri}", _serviceUri);
+ LogContext.LogDebug("Created NamespaceManager: {ServiceUri}", _serviceUri);
var namespaceManager = new NamespaceManager(_serviceUri, _settings);
@@ -95,7 +95,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Create NamespaceManager faulted: {ServiceUri}", _serviceUri);
+ LogContext.LogError(ex, "Create NamespaceManager faulted: {ServiceUri}", _serviceUri);
throw;
}
Index: src/MassTransit/Saga/InMemorySagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Saga/InMemorySagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Saga/InMemorySagaRepository.cs (date 1568024686281)
@@ -52,64 +52,63 @@
await _sagas.MarkInUse(context.CancellationToken).ConfigureAwait(false);
var needToLeaveSagas = true;
- var activity = LogContext.IfEnabled(OperationName.Saga.Send)?.StartActivity(new {context.CorrelationId});
- try
- {
- SagaInstance<TSaga> saga = _sagas[sagaId];
- if (saga != null)
- {
- await saga.MarkInUse(context.CancellationToken).ConfigureAwait(false);
- try
- {
- _sagas.Release();
- needToLeaveSagas = false;
+ using (var activity = LogContext.StartActivity(OperationName.Saga.Send, new {context.CorrelationId}))
+ {
+ try
+ {
+ SagaInstance<TSaga> saga = _sagas[sagaId];
+ if (saga != null)
+ {
+ await saga.MarkInUse(context.CancellationToken).ConfigureAwait(false);
+ try
+ {
+ _sagas.Release();
+ needToLeaveSagas = false;
- if (saga.IsRemoved)
- {
- saga.Release();
- saga = null;
- }
- else
- {
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
- sagaId, TypeMetadataCache<T>.ShortName);
+ if (saga.IsRemoved)
+ {
+ saga.Release();
+ saga = null;
+ }
+ else
+ {
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ sagaId, TypeMetadataCache<T>.ShortName);
- SagaConsumeContext<TSaga, T> sagaConsumeContext = new InMemorySagaConsumeContext<TSaga, T>(context, saga.Instance,
- () => Remove(saga, context.CancellationToken));
+ SagaConsumeContext<TSaga, T> sagaConsumeContext = new InMemorySagaConsumeContext<TSaga, T>(context, saga.Instance,
+ () => Remove(saga, context.CancellationToken));
- await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
- }
- }
- finally
- {
- saga?.Release();
- }
- }
+ await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
+ }
+ }
+ finally
+ {
+ saga?.Release();
+ }
+ }
- if (saga == null)
- {
- var missingSagaPipe = new MissingPipe<T>(this, next, true);
+ if (saga == null)
+ {
+ var missingSagaPipe = new MissingPipe<T>(this, next, true);
- await policy.Missing(context, missingSagaPipe).ConfigureAwait(false);
+ await policy.Missing(context, missingSagaPipe).ConfigureAwait(false);
- _sagas.Release();
- needToLeaveSagas = false;
- }
- }
- finally
- {
- if (needToLeaveSagas)
- _sagas.Release();
-
- activity?.Stop();
+ _sagas.Release();
+ needToLeaveSagas = false;
+ }
+ }
+ finally
+ {
+ if (needToLeaveSagas)
+ _sagas.Release();
+ }
}
}
async Task ISagaRepository<TSaga>.SendQuery<T>(SagaQueryConsumeContext<TSaga, T> context, ISagaPolicy<TSaga, T> policy,
IPipe<SagaConsumeContext<TSaga, T>> next)
{
- var activity = LogContext.IfEnabled(OperationName.Saga.SendQuery)?.StartActivity();
- try
+ using (var activity = LogContext.StartActivity(OperationName.Saga.SendQuery))
{
SagaInstance<TSaga>[] existingSagas = _sagas.Where(context.Query).ToArray();
if (existingSagas.Length == 0)
@@ -120,10 +119,6 @@
else
await Task.WhenAll(existingSagas.Select(instance => SendToInstance(context, policy, instance, next))).ConfigureAwait(false);
}
- finally
- {
- activity?.Stop();
- }
}
async Task SendToInstance<T>(SagaQueryConsumeContext<TSaga, T> context, ISagaPolicy<TSaga, T> policy, SagaInstance<TSaga> saga,
@@ -132,25 +127,25 @@
{
await saga.MarkInUse(context.CancellationToken).ConfigureAwait(false);
- var activity = LogContext.IfEnabled(OperationName.Saga.Send)?.StartActivity(new {saga.Instance.CorrelationId});
- try
- {
- if (saga.IsRemoved)
- return;
+ using (var activity = LogContext.StartActivity(OperationName.Saga.Send, new {saga.Instance.CorrelationId}))
+ {
+ try
+ {
+ if (saga.IsRemoved)
+ return;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
- saga.Instance.CorrelationId, TypeMetadataCache<T>.ShortName);
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ saga.Instance.CorrelationId, TypeMetadataCache<T>.ShortName);
- SagaConsumeContext<TSaga, T> sagaConsumeContext = new InMemorySagaConsumeContext<TSaga, T>(context, saga.Instance,
- () => Remove(saga, context.CancellationToken));
+ SagaConsumeContext<TSaga, T> sagaConsumeContext = new InMemorySagaConsumeContext<TSaga, T>(context, saga.Instance,
+ () => Remove(saga, context.CancellationToken));
- await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
- }
- finally
- {
- saga.Release();
-
- activity?.Stop();
+ await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
+ }
+ finally
+ {
+ saga.Release();
+ }
}
}
@@ -235,47 +230,47 @@
await instance.MarkInUse(context.CancellationToken).ConfigureAwait(false);
- var activity = LogContext.IfEnabled(OperationName.Saga.Add)?.StartActivity(new {context.Saga.CorrelationId});
- try
- {
- var proxy =
- new InMemorySagaConsumeContext<TSaga, TMessage>(context, context.Saga, () => RemoveNewSaga(instance, context.CancellationToken));
+ using (var activity = LogContext.StartActivity(OperationName.Saga.Add, new {context.Saga.CorrelationId}))
+ {
+ try
+ {
+ var proxy =
+ new InMemorySagaConsumeContext<TSaga, TMessage>(context, context.Saga, () => RemoveNewSaga(instance, context.CancellationToken));
- if (_withinLock)
- _repository.AddWithinLock(instance);
- else
- await _repository.Add(instance, context.CancellationToken).ConfigureAwait(false);
+ if (_withinLock)
+ _repository.AddWithinLock(instance);
+ else
+ await _repository.Add(instance, context.CancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
- context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
- try
- {
- await _next.Send(proxy).ConfigureAwait(false);
+ try
+ {
+ await _next.Send(proxy).ConfigureAwait(false);
- if (proxy.IsCompleted)
- {
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
- context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
+ if (proxy.IsCompleted)
+ {
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
- await RemoveNewSaga(instance, context.CancellationToken).ConfigureAwait(false);
- }
- }
- catch (Exception)
- {
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
- context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
+ await RemoveNewSaga(instance, context.CancellationToken).ConfigureAwait(false);
+ }
+ }
+ catch (Exception)
+ {
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
- await RemoveNewSaga(instance, context.CancellationToken).ConfigureAwait(false);
+ await RemoveNewSaga(instance, context.CancellationToken).ConfigureAwait(false);
- throw;
- }
- }
- finally
- {
- instance.Release();
-
- activity?.Stop();
+ throw;
+ }
+ }
+ finally
+ {
+ instance.Release();
+ }
}
}
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/JoinContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/JoinContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/JoinContextFactory.cs (date 1568023394674)
@@ -122,7 +122,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Join faulted");
+ LogContext.LogWarning(exception, "Join faulted");
}
}
Index: src/Persistence/MassTransit.DocumentDbIntegration/Saga/Pipeline/MissingPipe.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.DocumentDbIntegration/Saga/Pipeline/MissingPipe.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.DocumentDbIntegration/Saga/Pipeline/MissingPipe.cs (date 1568023295201)
@@ -43,7 +43,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
SagaConsumeContext<TSaga, TMessage> proxy =
Index: src/Persistence/MassTransit.DocumentDbIntegration/Saga/Context/DocumentDbSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.DocumentDbIntegration/Saga/Context/DocumentDbSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.DocumentDbIntegration/Saga/Context/DocumentDbSagaConsumeContext.cs (date 1568023295346)
@@ -43,7 +43,7 @@
await _client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(_databaseName, _collectionName, Saga.CorrelationId.ToString()), _requestOptions)
.ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
}
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/RenewLockFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/RenewLockFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/RenewLockFilter.cs (date 1568023394717)
@@ -91,7 +91,7 @@
await _context.RenewLockAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Renewed Lock: {MessageId}", _context.MessageId);
+ LogContext.LogDebug("Renewed Lock: {MessageId}", _context.MessageId);
delay = _delay;
}
@@ -105,14 +105,14 @@
_source.Cancel();
_completed.TrySetException(exception);
- LogContext.Warning?.Log(exception, "Lost Message Lock: {MessageId}", _context.MessageId);
+ LogContext.LogWarning(exception, "Lost Message Lock: {MessageId}", _context.MessageId);
}
catch (SessionLockLostException exception)
{
_source.Cancel();
_completed.TrySetException(exception);
- LogContext.Warning?.Log(exception, "Lost Message Lock: {MessageId}", _context.MessageId);
+ LogContext.LogWarning(exception, "Lost Message Lock: {MessageId}", _context.MessageId);
}
catch (MessagingException exception)
{
@@ -126,14 +126,14 @@
{
delay = TimeSpan.Zero;
- LogContext.Warning?.Log(exception, "Renew Lock Timeout (will retry): {MessageId}", _context.MessageId);
+ LogContext.LogWarning(exception, "Renew Lock Timeout (will retry): {MessageId}", _context.MessageId);
}
catch (Exception exception)
{
_source.Cancel();
_completed.TrySetException(exception);
- LogContext.Warning?.Log(exception, "Renew Lock Timeout: {MessageId}", _context.MessageId);
+ LogContext.LogWarning(exception, "Renew Lock Timeout: {MessageId}", _context.MessageId);
}
}
Index: src/MassTransit.AmazonSqsTransport/Transport/SqsReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Transport/SqsReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Transport/SqsReceiveTransport.cs (date 1568023406178)
@@ -118,7 +118,7 @@
async Task<AmazonSqsConnectException> ConvertToAmazonSqsConnectionException(Exception ex, string message)
{
- LogContext.Error?.Log(ex, message);
+ LogContext.LogError(ex, message);
var exception = new AmazonSqsConnectException(message + _host.ConnectionContextSupervisor, ex);
@@ -129,7 +129,7 @@
Task NotifyFaulted(Exception exception)
{
- LogContext.Error?.Log(exception, "AmazonSQS Connect Failed: {Host}", _host.Address);
+ LogContext.LogError(exception, "AmazonSQS Connect Failed: {Host}", _host.Address);
return _receiveEndpointContext.TransportObservers.Faulted(new ReceiveTransportFaultedEvent(_inputAddress, exception));
}
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/QueueSendEndpointContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/QueueSendEndpointContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/QueueSendEndpointContextFactory.cs (date 1568023295355)
@@ -36,7 +36,7 @@
protected override SendEndpointContext CreateClientContext(NamespaceContext leftContext, MessagingFactoryContext rightContext)
{
- LogContext.Debug?.Log("Creating Queue Client: {Queue}", _settings.EntityPath);
+ LogContext.LogDebug("Creating Queue Client: {Queue}", _settings.EntityPath);
var queueClient = rightContext.MessagingFactory.CreateQueueClient(_settings.EntityPath, ReceiveMode.PeekLock);
Index: src/MassTransit/Transports/InMemory/InMemoryReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Transports/InMemory/InMemoryReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Transports/InMemory/InMemoryReceiveTransport.cs (date 1568023576228)
@@ -60,32 +60,32 @@
var context = new InMemoryReceiveContext(_inputAddress, message, _receiveEndpointContext);
var delivery = _tracker.BeginDelivery();
- var activity = LogContext.IfEnabled(OperationName.Transport.Receive)?.StartActivity();
- activity.AddReceiveContextHeaders(context);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Receive))
+ {
+ activity.AddReceiveContextHeaders(context);
- try
- {
- await _receiveEndpointContext.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
+ try
+ {
+ await _receiveEndpointContext.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
- await _receiveEndpointContext.ReceivePipe.Send(context).ConfigureAwait(false);
+ await _receiveEndpointContext.ReceivePipe.Send(context).ConfigureAwait(false);
- await context.ReceiveCompleted.ConfigureAwait(false);
+ await context.ReceiveCompleted.ConfigureAwait(false);
- await _receiveEndpointContext.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ await _receiveEndpointContext.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- message.DeliveryCount++;
- }
- finally
- {
- activity?.Stop();
-
- delivery.Dispose();
+ message.DeliveryCount++;
+ }
+ finally
+ {
+ delivery.Dispose();
- context.Dispose();
+ context.Dispose();
+ }
}
}
Index: src/MassTransit/Transports/InMemory/InMemorySendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Transports/InMemory/InMemorySendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Transports/InMemory/InMemorySendTransport.cs (date 1568023605459)
@@ -33,36 +33,34 @@
var context = new InMemorySendContext<T>(message, cancellationToken);
- var activity = LogContext.IfEnabled(OperationName.Transport.Send)?.StartActivity(new {Exchange = ExchangeName});
- try
- {
- await pipe.Send(context).ConfigureAwait(false);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Send, new {Exchange = ExchangeName}))
+ {
+ try
+ {
+ await pipe.Send(context).ConfigureAwait(false);
- activity.AddSendContextHeaders(context);
+ activity.AddSendContextHeaders(context);
- var messageId = context.MessageId ?? NewId.NextGuid();
+ var messageId = context.MessageId ?? NewId.NextGuid();
- await _context.SendObservers.PreSend(context).ConfigureAwait(false);
+ await _context.SendObservers.PreSend(context).ConfigureAwait(false);
- var transportMessage = new InMemoryTransportMessage(messageId, context.Body, context.ContentType.MediaType, TypeMetadataCache<T>.ShortName);
+ var transportMessage = new InMemoryTransportMessage(messageId, context.Body, context.ContentType.MediaType, TypeMetadataCache<T>.ShortName);
- await _context.Exchange.Send(transportMessage).ConfigureAwait(false);
+ await _context.Exchange.Send(transportMessage).ConfigureAwait(false);
- context.LogSent();
+ context.LogSent();
- await _context.SendObservers.PostSend(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- context.LogFaulted(ex);
+ await _context.SendObservers.PostSend(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ context.LogFaulted(ex);
- await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
+ await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
Index: src/MassTransit.AzureServiceBusTransport/Pipeline/TopicSendEndpointContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Pipeline/TopicSendEndpointContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Pipeline/TopicSendEndpointContextFactory.cs (date 1568023294986)
@@ -35,7 +35,7 @@
protected override SendEndpointContext CreateClientContext(NamespaceContext leftContext, MessagingFactoryContext rightContext)
{
- LogContext.Debug?.Log("Creating Topic Client: {Queue}", _settings.EntityPath);
+ LogContext.LogDebug("Creating Topic Client: {Queue}", _settings.EntityPath);
var topicClient = rightContext.MessagingFactory.CreateTopicClient(_settings.EntityPath);
Index: src/Persistence/MassTransit.NHibernateIntegration/NHibernateSessionFactoryProvider.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.NHibernateIntegration/NHibernateSessionFactoryProvider.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.NHibernateIntegration/NHibernateSessionFactoryProvider.cs (date 1568023221085)
@@ -5,6 +5,7 @@
using System.Threading;
using Context;
using MassTransit.Saga;
+ using Microsoft.Extensions.Logging;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Cfg.Loquacious;
@@ -58,7 +59,7 @@
/// </summary>
public void UpdateSchema()
{
- LogContext.Debug?.Log("Updating schema for connection: {Connection}", Configuration);
+ LogContext.LogDebug("Updating schema for connection: {Connection}", Configuration);
new SchemaUpdate(Configuration).Execute(false, true);
}
Index: src/MassTransit/Transports/InMemory/InMemoryHost.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Transports/InMemory/InMemoryHost.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Transports/InMemory/InMemoryHost.cs (date 1568023295757)
@@ -43,7 +43,7 @@
{
LogContext.SetCurrentIfNull(DefaultLogContext);
- LogContext.Debug?.Log("Create receive transport: {Queue}", queueName);
+ LogContext.LogDebug("Create receive transport: {Queue}", queueName);
var queue = _messageFabric.GetQueue(queueName);
@@ -76,7 +76,7 @@
{
LogContext.SetCurrentIfNull(DefaultLogContext);
- LogContext.Debug?.Log("Connect receive endpoint: {Queue}", queueName);
+ LogContext.LogDebug("Connect receive endpoint: {Queue}", queueName);
var configuration = _hostConfiguration.CreateReceiveEndpointConfiguration(queueName);
@@ -97,7 +97,7 @@
return await _index.Get(queueName, async key =>
{
- LogContext.Debug?.Log("Create send transport: {Exchange}", queueName);
+ LogContext.LogDebug("Create send transport: {Exchange}", queueName);
var exchange = _messageFabric.GetExchange(queueName);
Index: src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaConsumeContext.cs (date 1568023269765)
@@ -30,7 +30,7 @@
await _session.DeleteAsync(Saga).ConfigureAwait(false);
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
}
Index: src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.NHibernateIntegration/Saga/NHibernateSagaRepository.cs (date 1568023406043)
@@ -77,7 +77,7 @@
}
else
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new NHibernateSagaConsumeContext<TSaga, T>(session, context, instance);
@@ -93,7 +93,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
if (transaction.IsActive)
@@ -132,7 +132,7 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
if (transaction.IsActive)
await transaction.RollbackAsync().ConfigureAwait(false);
@@ -141,7 +141,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
if (transaction.IsActive)
await transaction.RollbackAsync().ConfigureAwait(false);
@@ -162,12 +162,12 @@
inserted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
catch (GenericADOException ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
@@ -180,7 +180,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new NHibernateSagaConsumeContext<TSaga, T>(session, context, instance);
@@ -222,7 +222,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
SagaConsumeContext<TSaga, TMessage> proxy = new NHibernateSagaConsumeContext<TSaga, TMessage>(_session, context, context.Saga);
Index: src/MassTransit/Policies/PipeRetryExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Policies/PipeRetryExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Policies/PipeRetryExtensions.cs (date 1568023394655)
@@ -164,7 +164,7 @@
}
catch (Exception ex)
{
- LogContext.Warning?.Log(ex, "Repeating until cancelled: {Cancelled}", cancellationToken.IsCancellationRequested);
+ LogContext.LogWarning(ex, "Repeating until cancelled: {Cancelled}", cancellationToken.IsCancellationRequested);
}
}
}
Index: src/MassTransit.RabbitMqTransport/Topology/Builders/TopologyLayoutExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Topology/Builders/TopologyLayoutExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Topology/Builders/TopologyLayoutExtensions.cs (date 1568023835497)
@@ -9,13 +9,13 @@
{
foreach (var exchange in layout.Exchanges)
{
- LogContext.Info?.Log("Exchange: {ExchangeName}, type: {ExchangeType}, durable: {Durable}, auto-delete: {AutoDelete}", exchange.ExchangeName,
+ LogContext.LogInformation("Exchange: {ExchangeName}, type: {ExchangeType}, durable: {Durable}, auto-delete: {AutoDelete}", exchange.ExchangeName,
exchange.ExchangeType, exchange.Durable, exchange.AutoDelete);
}
foreach (var binding in layout.ExchangeBindings)
{
- LogContext.Info?.Log("Binding: source {Source}, destination: {Destination}, routingKey: {RoutingKey}", binding.Source.ExchangeName,
+ LogContext.LogInformation("Binding: source {Source}, destination: {Destination}, routingKey: {RoutingKey}", binding.Source.ExchangeName,
binding.Destination.ExchangeName, binding.RoutingKey);
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Transport/BrokeredMessageReceiver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Transport/BrokeredMessageReceiver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Transport/BrokeredMessageReceiver.cs (date 1568023928738)
@@ -58,61 +58,61 @@
context.TryGetPayload<MessageLockContext>(out var lockContext);
- var activity = LogContext.IfEnabled(OperationName.Transport.Receive)?.StartActivity();
- activity.AddReceiveContextHeaders(context);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Receive))
+ {
+ activity.AddReceiveContextHeaders(context);
- try
- {
- await _receiveEndpointContext.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
+ try
+ {
+ await _receiveEndpointContext.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
- if (message.SystemProperties.LockedUntilUtc <= DateTime.UtcNow)
- throw new MessageLockExpiredException(_inputAddress, $"The message lock expired: {message.MessageId}");
+ if (message.SystemProperties.LockedUntilUtc <= DateTime.UtcNow)
+ throw new MessageLockExpiredException(_inputAddress, $"The message lock expired: {message.MessageId}");
- if (message.ExpiresAtUtc < DateTime.UtcNow)
- throw new MessageTimeToLiveExpiredException(_inputAddress, $"The message TTL expired: {message.MessageId}");
+ if (message.ExpiresAtUtc < DateTime.UtcNow)
+ throw new MessageTimeToLiveExpiredException(_inputAddress, $"The message TTL expired: {message.MessageId}");
- await _receiveEndpointContext.ReceivePipe.Send(context).ConfigureAwait(false);
+ await _receiveEndpointContext.ReceivePipe.Send(context).ConfigureAwait(false);
- await context.ReceiveCompleted.ConfigureAwait(false);
+ await context.ReceiveCompleted.ConfigureAwait(false);
- if (lockContext != null)
- await lockContext.Complete().ConfigureAwait(false);
+ if (lockContext != null)
+ await lockContext.Complete().ConfigureAwait(false);
- await _receiveEndpointContext.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
- }
- catch (SessionLockLostException ex)
- {
- LogContext.Warning?.Log(ex, "Session Lock Lost: {MessageId", message.MessageId);
+ await _receiveEndpointContext.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
+ }
+ catch (SessionLockLostException ex)
+ {
+ LogContext.LogWarning(ex, "Session Lock Lost: {MessageId", message.MessageId);
- await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- }
- catch (MessageLockLostException ex)
- {
- LogContext.Warning?.Log(ex, "Session Lock Lost: {MessageId", message.MessageId);
+ await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ }
+ catch (MessageLockLostException ex)
+ {
+ LogContext.LogWarning(ex, "Session Lock Lost: {MessageId", message.MessageId);
- await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- if (lockContext == null)
- throw;
+ if (lockContext == null)
+ throw;
- try
- {
- await lockContext.Abandon(ex).ConfigureAwait(false);
- }
- catch (Exception exception)
- {
- LogContext.Warning?.Log(exception, "Abandon message faulted: {MessageId", message.MessageId);
- }
- }
- finally
- {
- activity?.Stop();
-
- context.Dispose();
+ try
+ {
+ await lockContext.Abandon(ex).ConfigureAwait(false);
+ }
+ catch (Exception exception)
+ {
+ LogContext.LogWarning(exception, "Abandon message faulted: {MessageId", message.MessageId);
+ }
+ }
+ finally
+ {
+ context.Dispose();
+ }
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Transport/ServiceBusSendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Transport/ServiceBusSendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Transport/ServiceBusSendTransport.cs (date 1568023944936)
@@ -44,7 +44,7 @@
protected override Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping send transport: {Address}", _context.Address);
+ LogContext.LogDebug("Stopping send transport: {Address}", _context.Address);
return base.StopSupervisor(context);
}
@@ -73,48 +73,46 @@
var context = new AzureServiceBusSendContext<T>(_message, _cancellationToken);
- var activity = LogContext.IfEnabled(OperationName.Transport.Send)?.StartActivity(new {_context.Address});
- try
- {
- await _pipe.Send(context).ConfigureAwait(false);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Send, new {_context.Address}))
+ {
+ try
+ {
+ await _pipe.Send(context).ConfigureAwait(false);
- activity.AddSendContextHeaders(context);
+ activity.AddSendContextHeaders(context);
- CopyIncomingIdentifiersIfPresent(context);
+ CopyIncomingIdentifiersIfPresent(context);
- if (IsCancelScheduledSend(context, out var sequenceNumber))
- {
- await CancelScheduledSend(clientContext, sequenceNumber).ConfigureAwait(false);
+ if (IsCancelScheduledSend(context, out var sequenceNumber))
+ {
+ await CancelScheduledSend(clientContext, sequenceNumber).ConfigureAwait(false);
- return;
- }
+ return;
+ }
- if (context.ScheduledEnqueueTimeUtc.HasValue)
- {
- var scheduled = await ScheduleSend(clientContext, context).ConfigureAwait(false);
- if (scheduled)
- return;
- }
+ if (context.ScheduledEnqueueTimeUtc.HasValue)
+ {
+ var scheduled = await ScheduleSend(clientContext, context).ConfigureAwait(false);
+ if (scheduled)
+ return;
+ }
- await _context.SendObservers.PreSend(context).ConfigureAwait(false);
+ await _context.SendObservers.PreSend(context).ConfigureAwait(false);
- var brokeredMessage = CreateBrokeredMessage(context);
+ var brokeredMessage = CreateBrokeredMessage(context);
- await clientContext.Send(brokeredMessage).ConfigureAwait(false);
+ await clientContext.Send(brokeredMessage).ConfigureAwait(false);
- context.LogSent();
+ context.LogSent();
- await _context.SendObservers.PostSend(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
+ await _context.SendObservers.PostSend(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
@@ -129,7 +127,7 @@
var enqueueTimeUtc = context.ScheduledEnqueueTimeUtc.Value;
if (enqueueTimeUtc < now)
{
- LogContext.Debug?.Log("The scheduled time was in the past, sending: {ScheduledTime}", context.ScheduledEnqueueTimeUtc);
+ LogContext.LogDebug("The scheduled time was in the past, sending: {ScheduledTime}", context.ScheduledEnqueueTimeUtc);
return false;
}
@@ -148,7 +146,7 @@
}
catch (ArgumentOutOfRangeException)
{
- LogContext.Debug?.Log("The scheduled time was rejected by the server, sending: {MessageId}", context.MessageId);
+ LogContext.LogDebug("The scheduled time was rejected by the server, sending: {MessageId}", context.MessageId);
return false;
}
@@ -160,11 +158,11 @@
{
await clientContext.CancelScheduledSend(sequenceNumber).ConfigureAwait(false);
- LogContext.Debug?.Log("Canceled scheduled message {SequenceNumber} {EntityPath}", sequenceNumber, clientContext.EntityPath);
+ LogContext.LogDebug("Canceled scheduled message {SequenceNumber} {EntityPath}", sequenceNumber, clientContext.EntityPath);
}
catch (MessageNotFoundException exception)
{
- LogContext.Warning?.Log(exception, "The scheduled message was not found: {SequenceNumber} {EntityPath}", sequenceNumber,
+ LogContext.LogWarning(exception, "The scheduled message was not found: {SequenceNumber} {EntityPath}", sequenceNumber,
clientContext.EntityPath);
}
}
Index: src/Samples/Sample.AzureFunctions.ServiceBus/Functions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Samples/Sample.AzureFunctions.ServiceBus/Functions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Samples/Sample.AzureFunctions.ServiceBus/Functions.cs (date 1568023835431)
@@ -20,7 +20,7 @@
{
LogContext.ConfigureCurrentLogContext(logger);
- LogContext.Info?.Log("Creating brokered message receiver");
+ LogContext.LogInformation("Creating brokered message receiver");
var handler = Bus.Factory.CreateBrokeredMessageReceiver(binder, cfg =>
{
@@ -40,7 +40,7 @@
{
LogContext.ConfigureCurrentLogContext(logger);
- LogContext.Info?.Log("Creating event hub receiver");
+ LogContext.LogInformation("Creating event hub receiver");
var handler = Bus.Factory.CreateEventDataReceiver(binder, cfg =>
{
@@ -61,7 +61,7 @@
{
public Task Consume(ConsumeContext<SubmitOrder> context)
{
- LogContext.Debug?.Log("Processing Order: {OrderNumber}", context.Message.OrderNumber);
+ LogContext.LogDebug("Processing Order: {OrderNumber}", context.Message.OrderNumber);
context.Publish<OrderReceived>(new
{
@@ -79,7 +79,7 @@
{
public async Task Consume(ConsumeContext<OrderReceived> context)
{
- LogContext.Debug?.Log("Received Order: {OrderNumber}", context.Message.OrderNumber);
+ LogContext.LogDebug("Received Order: {OrderNumber}", context.Message.OrderNumber);
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Transport/ReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Transport/ReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Transport/ReceiveTransport.cs (date 1568023405875)
@@ -90,7 +90,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Receive transport faulted: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(ex, "Receive transport faulted: {InputAddress}", _context.InputAddress);
await _context.TransportObservers.Faulted(new ReceiveTransportFaultedEvent(_context.InputAddress, ex))
.ConfigureAwait(false);
Index: src/MassTransit.Azure.ServiceBus.Core/Transport/Receiver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Transport/Receiver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Transport/Receiver.cs (date 1568023406078)
@@ -50,12 +50,12 @@
protected Task ExceptionHandler(ExceptionReceivedEventArgs args)
{
if (!(args.Exception is OperationCanceledException))
- LogContext.Error?.Log(args.Exception, "Exception on Receiver {InputAddress} during {Action}", _context.InputAddress,
+ LogContext.LogError(args.Exception, "Exception on Receiver {InputAddress} during {Action}", _context.InputAddress,
args.ExceptionReceivedContext.Action);
if (Tracker.ActiveDeliveryCount == 0)
{
- LogContext.Debug?.Log("Receiver shutdown completed: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Receiver shutdown completed: {InputAddress}", _context.InputAddress);
_deliveryComplete.TrySetResult(true);
@@ -75,7 +75,7 @@
protected override async Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping receiver: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Stopping receiver: {InputAddress}", _context.InputAddress);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -95,7 +95,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
}
}
@@ -131,7 +131,7 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/MassTransit/Configuration/CourierHostConfiguratorExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/CourierHostConfiguratorExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/CourierHostConfiguratorExtensions.cs (date 1568023295464)
@@ -82,7 +82,7 @@
if (factory == null)
throw new ArgumentNullException(nameof(factory));
- LogContext.Debug?.Log("Configuring Execute Activity: {ActivityType}, {ArgumentType}", TypeMetadataCache<TActivity>.ShortName,
+ LogContext.LogDebug("Configuring Execute Activity: {ActivityType}, {ArgumentType}", TypeMetadataCache<TActivity>.ShortName,
TypeMetadataCache<TArguments>.ShortName);
var specification = new ExecuteActivityHostSpecification<TActivity, TArguments>(factory, compensateAddress);
@@ -102,7 +102,7 @@
if (factory == null)
throw new ArgumentNullException(nameof(factory));
- LogContext.Debug?.Log("Configuring Execute Activity: {ActivityType}, {ArgumentType}", TypeMetadataCache<TActivity>.ShortName,
+ LogContext.LogDebug("Configuring Execute Activity: {ActivityType}, {ArgumentType}", TypeMetadataCache<TActivity>.ShortName,
TypeMetadataCache<TArguments>.ShortName);
var specification = new ExecuteActivityHostSpecification<TActivity, TArguments>(factory);
@@ -154,7 +154,7 @@
if (factory == null)
throw new ArgumentNullException(nameof(factory));
- LogContext.Debug?.Log("Configuring Compensate Activity: {ActivityType}, {LogType}", TypeMetadataCache<TActivity>.ShortName,
+ LogContext.LogDebug("Configuring Compensate Activity: {ActivityType}, {LogType}", TypeMetadataCache<TActivity>.ShortName,
TypeMetadataCache<TLog>.ShortName);
var specification = new CompensateActivityHostSpecification<TActivity, TLog>(factory);
Index: src/MassTransit/Saga/Factories/FactoryMethodSagaFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Saga/Factories/FactoryMethodSagaFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Saga/Factories/FactoryMethodSagaFactory.cs (date 1568023295363)
@@ -38,7 +38,7 @@
TSaga instance = _factoryMethod(context);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName, instance.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName, instance.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
var proxy = new NewSagaConsumeContext<TSaga, TMessage>(context, instance);
Index: src/MassTransit.Azure.ServiceBus.Core/Transport/SessionReceiver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Transport/SessionReceiver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Transport/SessionReceiver.cs (date 1568023295625)
@@ -40,7 +40,7 @@
using (var delivery = Tracker.BeginDelivery())
{
- LogContext.Debug?.Log("Receiving {DeliveryId}/{SessionId}:{MessageId}({EntityPath})", delivery.Id, message.SessionId, message.MessageId,
+ LogContext.LogDebug("Receiving {DeliveryId}/{SessionId}:{MessageId}({EntityPath})", delivery.Id, message.SessionId, message.MessageId,
_context.EntityPath);
await _messageReceiver.Handle(message, context => AddReceiveContextPayloads(context, messageSession, message)).ConfigureAwait(false);
Index: src/MassTransit/Saga/Factories/DefaultSagaFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Saga/Factories/DefaultSagaFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Saga/Factories/DefaultSagaFactory.cs (date 1568023294785)
@@ -32,7 +32,7 @@
TSaga instance = SagaMetadataCache<TSaga>.FactoryMethod(context.CorrelationId.Value);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName, instance.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName, instance.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
var proxy = new NewSagaConsumeContext<TSaga, TMessage>(context, instance);
Index: src/MassTransit.ActiveMqTransport/Contexts/ActiveMqConnectionContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Contexts/ActiveMqConnectionContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Contexts/ActiveMqConnectionContext.cs (date 1568023394915)
@@ -49,7 +49,7 @@
Task IAsyncDisposable.DisposeAsync(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Disconnecting: {Host}", Description);
+ LogContext.LogDebug("Disconnecting: {Host}", Description);
try
{
@@ -59,10 +59,10 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Close Connection Faulted: {Host}", Description);
+ LogContext.LogWarning(exception, "Close Connection Faulted: {Host}", Description);
}
- LogContext.Debug?.Log("Disconnected: {Host}", Description);
+ LogContext.LogDebug("Disconnected: {Host}", Description);
return TaskUtil.Completed;
}
Index: src/MassTransit.ActiveMqTransport/Contexts/ActiveMqSessionContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Contexts/ActiveMqSessionContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Contexts/ActiveMqSessionContext.cs (date 1568023394921)
@@ -34,7 +34,7 @@
public async Task DisposeAsync(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Closing session: {Host}", _connectionContext.Description);
+ LogContext.LogDebug("Closing session: {Host}", _connectionContext.Description);
if (_session != null)
{
@@ -46,7 +46,7 @@
}
catch (Exception ex)
{
- LogContext.Warning?.Log(ex, "Close session faulted: {Host}", _connectionContext.Description);
+ LogContext.LogWarning(ex, "Close session faulted: {Host}", _connectionContext.Description);
}
_session.Dispose();
Index: src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqConsumerFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqConsumerFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqConsumerFilter.cs (date 1568023295315)
@@ -63,7 +63,7 @@
await _context.TransportObservers.Completed(new ReceiveTransportCompletedEvent(inputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", inputAddress,
+ LogContext.LogDebug("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", inputAddress,
metrics.DeliveryCount, metrics.ConcurrentDeliveryCount);
}
}
Index: src/MassTransit.ActiveMqTransport/Pipeline/ConfigureTopologyFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Pipeline/ConfigureTopologyFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Pipeline/ConfigureTopologyFilter.cs (date 1568023295604)
@@ -64,28 +64,28 @@
Task Declare(SessionContext context, Topic topic)
{
- LogContext.Debug?.Log("Get topic {Topic}", topic);
+ LogContext.LogDebug("Get topic {Topic}", topic);
return context.GetTopic(topic.EntityName);
}
Task Declare(SessionContext context, Queue queue)
{
- LogContext.Debug?.Log("Get queue {Queue}", queue);
+ LogContext.LogDebug("Get queue {Queue}", queue);
return context.GetQueue(queue.EntityName);
}
Task Delete(SessionContext context, Topic topic)
{
- LogContext.Debug?.Log("Delete Topic {Topic}", topic);
+ LogContext.LogDebug("Delete Topic {Topic}", topic);
return context.DeleteTopic(topic.EntityName);
}
Task Delete(SessionContext context, Queue queue)
{
- LogContext.Debug?.Log("Delete Queue {Queue}", queue);
+ LogContext.LogDebug("Delete Queue {Queue}", queue);
return context.DeleteQueue(queue.EntityName);
}
Index: src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqBasicConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqBasicConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Pipeline/ActiveMqBasicConsumer.cs (date 1568023851450)
@@ -77,37 +77,37 @@
context.GetOrAddPayload(() => _session.ConnectionContext);
- var activity = LogContext.IfEnabled(OperationName.Transport.Receive)?.StartActivity();
- activity.AddReceiveContextHeaders(context);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Receive))
+ {
+ activity.AddReceiveContextHeaders(context);
- try
- {
- if (!_pending.TryAdd(message.NMSMessageId, context))
- LogContext.Warning?.Log("Duplicate message: {MessageId}", message.NMSMessageId);
+ try
+ {
+ if (!_pending.TryAdd(message.NMSMessageId, context))
+ LogContext.LogWarning("Duplicate message: {MessageId}", message.NMSMessageId);
- await _context.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
+ await _context.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
- await _context.ReceivePipe.Send(context).ConfigureAwait(false);
+ await _context.ReceivePipe.Send(context).ConfigureAwait(false);
- await context.ReceiveCompleted.ConfigureAwait(false);
+ await context.ReceiveCompleted.ConfigureAwait(false);
- message.Acknowledge();
+ message.Acknowledge();
- await _context.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await _context.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- }
- finally
- {
- activity?.Stop();
-
- delivery.Dispose();
+ await _context.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await _context.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ }
+ finally
+ {
+ delivery.Dispose();
- _pending.TryRemove(message.NMSMessageId, out _);
+ _pending.TryRemove(message.NMSMessageId, out _);
- context.Dispose();
+ context.Dispose();
+ }
}
}
@@ -119,7 +119,7 @@
{
if (IsStopping)
{
- LogContext.Debug?.Log("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
_deliveryComplete.TrySetResult(true);
}
@@ -133,13 +133,13 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "DeliveryComplete faulted during shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(exception, "DeliveryComplete faulted during shutdown: {InputAddress}", _context.InputAddress);
}
}
protected override async Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Stopping consumer: {InputAddress}", _context.InputAddress);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -158,7 +158,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
}
}
@@ -169,7 +169,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for consumer shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for consumer shutdown: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/MassTransit.SignalR/MassTransitMessageDataHubLifetimeManager.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/MassTransitMessageDataHubLifetimeManager.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/MassTransitMessageDataHubLifetimeManager.cs (date 1568023835493)
@@ -69,7 +69,7 @@
public override async Task SendAllAsync(string methodName, object[] args, CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing All<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing All<THub> message to MassTransit.");
await _publishEndpoint.Publish<AllMessageData<THub>>(
new {Messages = await _protocols.ToProtocolDictionary(methodName, args).ToMessageData(_repository)}, cancellationToken);
}
@@ -77,7 +77,7 @@
public override async Task SendAllExceptAsync(string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds,
CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing All<THub> message to MassTransit, with exceptions.");
+ LogContext.LogInformation("Publishing All<THub> message to MassTransit, with exceptions.");
await _publishEndpoint.Publish<AllMessageData<THub>>(
new
{
@@ -101,7 +101,7 @@
return;
}
- LogContext.Info?.Log("Publishing Connection<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing Connection<THub> message to MassTransit.");
await _publishEndpoint.Publish<ConnectionMessageData<THub>>(new
{
ConnectionId = connectionId,
@@ -129,7 +129,7 @@
},
cancellationToken));
- LogContext.Info?.Log("Publishing multiple Connection<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple Connection<THub> messages to MassTransit.");
await Task.WhenAll(publishTasks);
}
}
@@ -139,7 +139,7 @@
if (groupName == null)
throw new ArgumentNullException(nameof(groupName));
- LogContext.Info?.Log("Publishing Group<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing Group<THub> message to MassTransit.");
await _publishEndpoint.Publish<GroupMessageData<THub>>(new
{
GroupName = groupName,
@@ -154,7 +154,7 @@
if (groupName == null)
throw new ArgumentNullException(nameof(groupName));
- LogContext.Info?.Log("Publishing Group<THub> message to MassTransit, with exceptions.");
+ LogContext.LogInformation("Publishing Group<THub> message to MassTransit, with exceptions.");
await _publishEndpoint.Publish<GroupMessageData<THub>>(
new
{
@@ -185,14 +185,14 @@
}, cancellationToken));
}
- LogContext.Info?.Log("Publishing multiple Group<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple Group<THub> messages to MassTransit.");
await Task.WhenAll(publishTasks);
}
}
public override async Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing User<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing User<THub> message to MassTransit.");
await _publishEndpoint.Publish<UserMessageData<THub>>(new
{
UserId = userId,
@@ -218,7 +218,7 @@
Messages = await protocolDictionary.ToMessageData(_repository)
}, cancellationToken));
- LogContext.Info?.Log("Publishing multiple User<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple User<THub> messages to MassTransit.");
await Task.WhenAll(publishTasks);
}
}
@@ -243,7 +243,7 @@
// Publish to mass transit group management instead, but it waits for an ack...
try
{
- LogContext.Info?.Log("Publishing add GroupManagement<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing add GroupManagement<THub> message to MassTransit.");
RequestHandle<GroupManagement<THub>> request =
_groupManagementRequestClient.Create(new
{
@@ -255,12 +255,12 @@
cancellationToken);
Response<Ack<THub>> ack = await request.GetResponse<Ack<THub>>();
- LogContext.Info?.Log($"Request Received for add GroupManagement<THub> from {ack.Message.ServerName}.");
+ LogContext.LogInformation($"Request Received for add GroupManagement<THub> from {ack.Message.ServerName}.");
}
catch (RequestTimeoutException e)
{
// That's okay, just log and swallow
- LogContext.Warning?.Log(e, "GroupManagement<THub> add ack timed out.", e);
+ LogContext.LogWarning(e, "GroupManagement<THub> add ack timed out.", e);
}
}
@@ -284,7 +284,7 @@
// Publish to mass transit group management instead, but it waits for an ack...
try
{
- LogContext.Info?.Log("Publishing remove GroupManagement<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing remove GroupManagement<THub> message to MassTransit.");
RequestHandle<GroupManagement<THub>> request =
_groupManagementRequestClient.Create(new
{
@@ -296,12 +296,12 @@
cancellationToken);
Response<Ack<THub>> ack = await request.GetResponse<Ack<THub>>();
- LogContext.Info?.Log($"Request Received for remove GroupManagement<THub> from {ack.Message.ServerName}.");
+ LogContext.LogInformation($"Request Received for remove GroupManagement<THub> from {ack.Message.ServerName}.");
}
catch (RequestTimeoutException e)
{
// That's okay, just log and swallow
- LogContext.Warning?.Log(e, "GroupManagement<THub> remove ack timed out.", e);
+ LogContext.LogWarning(e, "GroupManagement<THub> remove ack timed out.", e);
}
}
Index: src/MassTransit.SignalR/MassTransitHubLifetimeManager.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/MassTransitHubLifetimeManager.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/MassTransitHubLifetimeManager.cs (date 1568023835505)
@@ -65,14 +65,14 @@
public override Task SendAllAsync(string methodName, object[] args, CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing All<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing All<THub> message to MassTransit.");
return _publishEndpoint.Publish<All<THub>>(new {Messages = _protocols.ToProtocolDictionary(methodName, args)}, cancellationToken);
}
public override Task SendAllExceptAsync(string methodName, object[] args, IReadOnlyList<string> excludedConnectionIds,
CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing All<THub> message to MassTransit, with exceptions.");
+ LogContext.LogInformation("Publishing All<THub> message to MassTransit, with exceptions.");
return _publishEndpoint.Publish<All<THub>>(
new {Messages = _protocols.ToProtocolDictionary(methodName, args), ExcludedConnectionIds = excludedConnectionIds.ToArray()}, cancellationToken);
}
@@ -91,7 +91,7 @@
return connection.WriteAsync(new InvocationMessage(methodName, args)).AsTask();
}
- LogContext.Info?.Log("Publishing Connection<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing Connection<THub> message to MassTransit.");
return _publishEndpoint.Publish<Connection<THub>>(new {ConnectionId = connectionId, Messages = _protocols.ToProtocolDictionary(methodName, args)},
cancellationToken);
}
@@ -111,7 +111,7 @@
publishTasks.Add(_publishEndpoint.Publish<Connection<THub>>(new {ConnectionId = connectionId, Messages = protocolDictionary},
cancellationToken));
- LogContext.Info?.Log("Publishing multiple Connection<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple Connection<THub> messages to MassTransit.");
return Task.WhenAll(publishTasks);
}
@@ -123,7 +123,7 @@
if (groupName == null)
throw new ArgumentNullException(nameof(groupName));
- LogContext.Info?.Log("Publishing Group<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing Group<THub> message to MassTransit.");
return _publishEndpoint.Publish<Group<THub>>(new {GroupName = groupName, Messages = _protocols.ToProtocolDictionary(methodName, args)},
cancellationToken);
}
@@ -134,7 +134,7 @@
if (groupName == null)
throw new ArgumentNullException(nameof(groupName));
- LogContext.Info?.Log("Publishing Group<THub> message to MassTransit, with exceptions.");
+ LogContext.LogInformation("Publishing Group<THub> message to MassTransit, with exceptions.");
return _publishEndpoint.Publish<Group<THub>>(
new
{
@@ -158,7 +158,7 @@
publishTasks.Add(_publishEndpoint.Publish<Group<THub>>(new {GroupName = groupName, Messages = protocolDictionary}, cancellationToken));
}
- LogContext.Info?.Log("Publishing multiple Group<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple Group<THub> messages to MassTransit.");
return Task.WhenAll(publishTasks);
}
@@ -167,7 +167,7 @@
public override Task SendUserAsync(string userId, string methodName, object[] args, CancellationToken cancellationToken = default)
{
- LogContext.Info?.Log("Publishing User<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing User<THub> message to MassTransit.");
return _publishEndpoint.Publish<User<THub>>(new {UserId = userId, Messages = _protocols.ToProtocolDictionary(methodName, args)}, cancellationToken);
}
@@ -184,7 +184,7 @@
foreach (var userId in userIds)
publishTasks.Add(_publishEndpoint.Publish<User<THub>>(new {UserId = userId, Messages = protocolDictionary}, cancellationToken));
- LogContext.Info?.Log("Publishing multiple User<THub> messages to MassTransit.");
+ LogContext.LogInformation("Publishing multiple User<THub> messages to MassTransit.");
return Task.WhenAll(publishTasks);
}
@@ -211,18 +211,18 @@
// Publish to mass transit group management instead, but it waits for an ack...
try
{
- LogContext.Info?.Log("Publishing add GroupManagement<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing add GroupManagement<THub> message to MassTransit.");
RequestHandle<GroupManagement<THub>> request =
_groupManagementRequestClient.Create(new {ConnectionId = connectionId, GroupName = groupName, ServerName, Action = GroupAction.Add},
cancellationToken);
Response<Ack<THub>> ack = await request.GetResponse<Ack<THub>>().ConfigureAwait(false);
- LogContext.Info?.Log($"Request Received for add GroupManagement<THub> from {ack.Message.ServerName}.");
+ LogContext.LogInformation($"Request Received for add GroupManagement<THub> from {ack.Message.ServerName}.");
}
catch (RequestTimeoutException e)
{
// That's okay, just log and swallow
- LogContext.Warning?.Log(e, "GroupManagement<THub> add ack timed out.", e);
+ LogContext.LogWarning(e, "GroupManagement<THub> add ack timed out.", e);
}
}
@@ -246,18 +246,18 @@
// Publish to mass transit group management instead, but it waits for an ack...
try
{
- LogContext.Info?.Log("Publishing remove GroupManagement<THub> message to MassTransit.");
+ LogContext.LogInformation("Publishing remove GroupManagement<THub> message to MassTransit.");
RequestHandle<GroupManagement<THub>> request =
_groupManagementRequestClient.Create(new {ConnectionId = connectionId, GroupName = groupName, ServerName, Action = GroupAction.Remove},
cancellationToken);
Response<Ack<THub>> ack = await request.GetResponse<Ack<THub>>().ConfigureAwait(false);
- LogContext.Info?.Log($"Request Received for remove GroupManagement<THub> from {ack.Message.ServerName}.");
+ LogContext.LogInformation($"Request Received for remove GroupManagement<THub> from {ack.Message.ServerName}.");
}
catch (RequestTimeoutException e)
{
// That's okay, just log and swallow
- LogContext.Warning?.Log(e, "GroupManagement<THub> remove ack timed out.", e);
+ LogContext.LogWarning(e, "GroupManagement<THub> remove ack timed out.", e);
}
}
Index: src/MassTransit.Azure.ServiceBus.Core.Tests/TwoScopeAzureServiceBusTestFixture.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core.Tests/TwoScopeAzureServiceBusTestFixture.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core.Tests/TwoScopeAzureServiceBusTestFixture.cs (date 1568023406146)
@@ -105,7 +105,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SecondBus Stop failed");
+ LogContext.LogError(ex, "SecondBus Stop failed");
}
finally
{
Index: src/MassTransit/Configuration/Metadata/SagaMetadataCache.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/Metadata/SagaMetadataCache.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/Metadata/SagaMetadataCache.cs (date 1568023405904)
@@ -94,7 +94,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Generate constructor instance factory faulted: {SagaType}", TypeMetadataCache<TSaga>.ShortName);
+ LogContext.LogError(ex, "Generate constructor instance factory faulted: {SagaType}", TypeMetadataCache<TSaga>.ShortName);
}
}
@@ -115,7 +115,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Generate property instance factory faulted: {SagaType}", TypeMetadataCache<TSaga>.ShortName);
+ LogContext.LogError(ex, "Generate property instance factory faulted: {SagaType}", TypeMetadataCache<TSaga>.ShortName);
}
}
Index: src/MassTransit.SignalR/Consumers/UserBaseConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/Consumers/UserBaseConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/Consumers/UserBaseConsumer.cs (date 1568023394803)
@@ -40,7 +40,7 @@
}
catch (Exception e)
{
- LogContext.Warning?.Log(e, "Failed to write message");
+ LogContext.LogWarning(e, "Failed to write message");
}
}
}
Index: src/MassTransit.SignalR/Consumers/ConnectionBaseConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/Consumers/ConnectionBaseConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/Consumers/ConnectionBaseConsumer.cs (date 1568023394663)
@@ -31,7 +31,7 @@
}
catch (Exception e)
{
- LogContext.Warning?.Log(e, "Failed to write message");
+ LogContext.LogWarning(e, "Failed to write message");
}
}
}
Index: src/MassTransit.SignalR/Consumers/AllBaseConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/Consumers/AllBaseConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/Consumers/AllBaseConsumer.cs (date 1568023394784)
@@ -39,7 +39,7 @@
}
catch (Exception e)
{
- LogContext.Warning?.Log(e, "Failed to write message");
+ LogContext.LogWarning(e, "Failed to write message");
}
}
}
Index: src/MassTransit/Util/Scanning/AssemblyFinder.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Util/Scanning/AssemblyFinder.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Util/Scanning/AssemblyFinder.cs (date 1568023394588)
@@ -57,7 +57,7 @@
public static IEnumerable<Assembly> FindAssemblies(string assemblyPath, AssemblyLoadFailure loadFailure, bool includeExeFiles, AssemblyFilter filter)
{
- LogContext.Debug?.Log("Scanning assembly directory: {Path}", assemblyPath);
+ LogContext.LogDebug("Scanning assembly directory: {Path}", assemblyPath);
IEnumerable<string> dllFiles = Directory.EnumerateFiles(assemblyPath, "*.dll", SearchOption.AllDirectories).ToList();
IEnumerable<string> files = dllFiles;
@@ -77,7 +77,7 @@
var filterName = Path.GetFileName(file);
if (!filter(filterName))
{
- LogContext.Debug?.Log("Filtered assembly: {File}", file);
+ LogContext.LogDebug("Filtered assembly: {File}", file);
continue;
}
@@ -89,7 +89,7 @@
}
catch (BadImageFormatException exception)
{
- LogContext.Warning?.Log(exception, "Assembly Scan failed: {Name}", name);
+ LogContext.LogWarning(exception, "Assembly Scan failed: {Name}", name);
continue;
}
@@ -115,7 +115,7 @@
}
catch (BadImageFormatException exception)
{
- LogContext.Warning?.Log(exception, "Assembly Scan failed: {Name}", name);
+ LogContext.LogWarning(exception, "Assembly Scan failed: {Name}", name);
continue;
}
Index: src/MassTransit.SignalR/Consumers/GroupBaseConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.SignalR/Consumers/GroupBaseConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.SignalR/Consumers/GroupBaseConsumer.cs (date 1568023394901)
@@ -44,7 +44,7 @@
}
catch (Exception e)
{
- LogContext.Warning?.Log(e, "Failed to write message");
+ LogContext.LogWarning(e, "Failed to write message");
}
}
}
Index: src/MassTransit.ActiveMqTransport.Tests/DelayRetry_Specs.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport.Tests/DelayRetry_Specs.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport.Tests/DelayRetry_Specs.cs (date 1568023835475)
@@ -245,7 +245,7 @@
public Consumer()
{
- LogContext.Info?.Log("Creating consumer");
+ LogContext.LogInformation("Creating consumer");
}
public Task Consume(ConsumeContext<PingMessage> context)
Index: src/MassTransit/Conductor/Client/ServiceClient.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Conductor/Client/ServiceClient.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Conductor/Client/ServiceClient.cs (date 1568023394751)
@@ -73,7 +73,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "MessageClient Dispose faulted: (client-id: {ClientId})", _clientId);
+ LogContext.LogWarning(exception, "MessageClient Dispose faulted: (client-id: {ClientId})", _clientId);
}
}
Index: src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaRepository.cs (date 1568023406191)
@@ -161,7 +161,7 @@
}
else
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new EntityFrameworkSagaConsumeContext<TSaga, T>(dbContext, context, instance);
@@ -181,7 +181,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -194,7 +194,7 @@
}
else
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
TypeMetadataCache<T>.ShortName);
try
@@ -203,7 +203,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
}
@@ -211,7 +211,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
TypeMetadataCache<T>.ShortName);
try
@@ -220,7 +220,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -326,7 +326,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -345,7 +345,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
}
@@ -353,7 +353,7 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
TypeMetadataCache<T>.ShortName);
try
@@ -362,7 +362,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -375,10 +375,10 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
@@ -407,7 +407,7 @@
entity = dbContext.Set<TSaga>().Add(instance);
await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
return true;
@@ -419,7 +419,7 @@
// see here for details: https://www.davideguida.com/how-to-reset-the-entities-state-on-a-entity-framework-db-context/
dbContext.Entry(entity).State = EntityState.Detached;
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
@@ -432,7 +432,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new EntityFrameworkSagaConsumeContext<TSaga, T>(dbContext, context, instance);
@@ -483,7 +483,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
var proxy = new EntityFrameworkSagaConsumeContext<TSaga, TMessage>(_dbContext, context, context.Saga, false);
Index: src/MassTransit/Conductor/Client/MessageClient.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Conductor/Client/MessageClient.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Conductor/Client/MessageClient.cs (date 1568023294916)
@@ -43,7 +43,7 @@
public async Task Consume(ConsumeContext<Down<TMessage>> context)
{
- LogContext.Debug?.Log("Endpoint Down received: (service-address: {ServiceAddress}, endpoint-address: {EndpointAddress}, client-id: {ClientId})",
+ LogContext.LogDebug("Endpoint Down received: (service-address: {ServiceAddress}, endpoint-address: {EndpointAddress}, client-id: {ClientId})",
context.Message.ServiceAddress, context.Message.Endpoint.EndpointAddress, ClientId);
try
@@ -63,7 +63,7 @@
public async Task Consume(ConsumeContext<Up<TMessage>> context)
{
- LogContext.Debug?.Log("Endpoint Up received: (service-address: {ServiceAddress}, endpoint-address: {EndpointAddress}, client-id: {ClientId})",
+ LogContext.LogDebug("Endpoint Up received: (service-address: {ServiceAddress}, endpoint-address: {EndpointAddress}, client-id: {ClientId})",
context.Message.ServiceAddress, context.Message.Endpoint.EndpointAddress, ClientId);
_distribution.Add(context.Message.Endpoint);
@@ -108,7 +108,7 @@
public async Task Link(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Requesting Link to {MessageType} (client-id: {ClientId})", TypeMetadataCache<TMessage>.ShortName, ClientId);
+ LogContext.LogDebug("Requesting Link to {MessageType} (client-id: {ClientId})", TypeMetadataCache<TMessage>.ShortName, ClientId);
using (RequestHandle<Link<TMessage>> request = _clientFactory.CreateRequestClient<Link<TMessage>>().Create(new {ClientId}, cancellationToken))
{
@@ -118,7 +118,7 @@
await _index.Get(response.Message.Endpoint.EndpointId, id => Task.FromResult(response.Message.Endpoint)).ConfigureAwait(false);
- LogContext.Debug?.Log("Linked to {InstanceAddress} for {MessageType} (client-id: {ClientId})",
+ LogContext.LogDebug("Linked to {InstanceAddress} for {MessageType} (client-id: {ClientId})",
response.Message.Endpoint.InstanceAddress, TypeMetadataCache<TMessage>.ShortName, ClientId);
}
}
Index: src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.EntityFrameworkIntegration/Saga/EntityFrameworkSagaConsumeContext.cs (date 1568023295075)
@@ -45,7 +45,7 @@
{
_dbContext.Set<TSaga>().Remove(Saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
await _dbContext.SaveChangesAsync(CancellationToken).ConfigureAwait(false);
Index: src/MassTransit.RabbitMqTransport/Transport/SequentialEndpointResolver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Transport/SequentialEndpointResolver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Transport/SequentialEndpointResolver.cs (date 1568023295486)
@@ -42,7 +42,7 @@
}
while (string.IsNullOrWhiteSpace(_lastHost));
- LogContext.Debug?.Log("Returning next host: {Host}", _lastHost);
+ LogContext.LogDebug("Returning next host: {Host}", _lastHost);
Interlocked.Increment(ref _nextHostIndex);
Index: src/MassTransit.RabbitMqTransport/Transport/RabbitMqSendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Transport/RabbitMqSendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Transport/RabbitMqSendTransport.cs (date 1568023974539)
@@ -52,7 +52,7 @@
protected override Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping send transport: {Exchange}", _context.Exchange);
+ LogContext.LogDebug("Stopping send transport: {Exchange}", _context.Exchange);
return base.StopSupervisor(context);
}
@@ -86,60 +86,58 @@
var context = new BasicPublishRabbitMqSendContext<T>(properties, _context.Exchange, _message, _cancellationToken);
- var activity = LogContext.IfEnabled(OperationName.Transport.Send)?.StartActivity(new {_context.Exchange});
- try
- {
- await _pipe.Send(context).ConfigureAwait(false);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Send, new {_context.Exchange}))
+ {
+ try
+ {
+ await _pipe.Send(context).ConfigureAwait(false);
- activity.AddSendContextHeaders(context);
+ activity.AddSendContextHeaders(context);
- byte[] body = context.Body;
+ byte[] body = context.Body;
- if (context.TryGetPayload(out PublishContext publishContext))
- context.Mandatory = context.Mandatory || publishContext.Mandatory;
+ if (context.TryGetPayload(out PublishContext publishContext))
+ context.Mandatory = context.Mandatory || publishContext.Mandatory;
- if (properties.Headers == null)
- properties.Headers = new Dictionary<string, object>();
+ if (properties.Headers == null)
+ properties.Headers = new Dictionary<string, object>();
- properties.ContentType = context.ContentType.MediaType;
+ properties.ContentType = context.ContentType.MediaType;
- properties.Headers["Content-Type"] = context.ContentType.MediaType;
+ properties.Headers["Content-Type"] = context.ContentType.MediaType;
- SetHeaders(properties.Headers, context.Headers);
+ SetHeaders(properties.Headers, context.Headers);
- properties.Persistent = context.Durable;
+ properties.Persistent = context.Durable;
- if (context.MessageId.HasValue)
- properties.MessageId = context.MessageId.ToString();
+ if (context.MessageId.HasValue)
+ properties.MessageId = context.MessageId.ToString();
- if (context.CorrelationId.HasValue)
- properties.CorrelationId = context.CorrelationId.ToString();
+ if (context.CorrelationId.HasValue)
+ properties.CorrelationId = context.CorrelationId.ToString();
- if (context.TimeToLive.HasValue)
- properties.Expiration = context.TimeToLive.Value.TotalMilliseconds.ToString("F0", CultureInfo.InvariantCulture);
+ if (context.TimeToLive.HasValue)
+ properties.Expiration = context.TimeToLive.Value.TotalMilliseconds.ToString("F0", CultureInfo.InvariantCulture);
- await _context.SendObservers.PreSend(context).ConfigureAwait(false);
+ await _context.SendObservers.PreSend(context).ConfigureAwait(false);
- var publishTask = modelContext.BasicPublishAsync(context.Exchange, context.RoutingKey ?? "", context.Mandatory,
- context.BasicProperties, body, context.AwaitAck);
+ var publishTask = modelContext.BasicPublishAsync(context.Exchange, context.RoutingKey ?? "", context.Mandatory,
+ context.BasicProperties, body, context.AwaitAck);
- await publishTask.WithCancellation(context.CancellationToken).ConfigureAwait(false);
+ await publishTask.WithCancellation(context.CancellationToken).ConfigureAwait(false);
- context.LogSent();
+ context.LogSent();
- await _context.SendObservers.PostSend(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- context.LogFaulted(ex);
+ await _context.SendObservers.PostSend(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ context.LogFaulted(ex);
- await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
+ await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
Index: src/MassTransit/Conductor/Server/ServiceEndpoint.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Conductor/Server/ServiceEndpoint.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Conductor/Server/ServiceEndpoint.cs (date 1568023394620)
@@ -96,7 +96,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Failed to notify service endpoint up: {InstanceAddress}", EndpointInfo.InstanceAddress);
+ LogContext.LogWarning(exception, "Failed to notify service endpoint up: {InstanceAddress}", EndpointInfo.InstanceAddress);
}
}
@@ -108,7 +108,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Failed to notify service endpoint down: {InstanceAddress}", EndpointInfo.InstanceAddress);
+ LogContext.LogWarning(exception, "Failed to notify service endpoint down: {InstanceAddress}", EndpointInfo.InstanceAddress);
}
}
Index: src/MassTransit.RabbitMqTransport/Transport/RabbitMqReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Transport/RabbitMqReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Transport/RabbitMqReceiveTransport.cs (date 1568023406003)
@@ -122,7 +122,7 @@
async Task<RabbitMqConnectionException> ConvertToRabbitMqConnectionException(Exception ex, string message)
{
- LogContext.Error?.Log(ex, message);
+ LogContext.LogError(ex, message);
var exception = new RabbitMqConnectionException(message + _host.ConnectionContextSupervisor, ex);
@@ -133,7 +133,7 @@
Task NotifyFaulted(RabbitMqConnectionException exception)
{
- LogContext.Error?.Log(exception, "RabbitMQ Connect Failed: {Host}", _host.Settings.ToDescription());
+ LogContext.LogError(exception, "RabbitMQ Connect Failed: {Host}", _host.Settings.ToDescription());
return _receiveEndpointContext.TransportObservers.Faulted(new ReceiveTransportFaultedEvent(_inputAddress, exception));
}
Index: src/MassTransit.RabbitMqTransport/Transport/RabbitMqHost.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Transport/RabbitMqHost.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Transport/RabbitMqHost.cs (date 1568023294812)
@@ -96,7 +96,7 @@
{
LogContext.SetCurrentIfNull(DefaultLogContext);
- LogContext.Debug?.Log("Connect receive endpoint: {Queue}", queueName);
+ LogContext.LogDebug("Connect receive endpoint: {Queue}", queueName);
var configuration = _hostConfiguration.CreateReceiveEndpointConfiguration(queueName);
Index: src/MassTransit/Context/LogContextExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/LogContextExtensions.cs (date 1568024544080)
+++ src/MassTransit/Context/LogContextExtensions.cs (date 1568024544080)
@@ -0,0 +1,49 @@
+namespace MassTransit.Context
+{
+ using System;
+ using Microsoft.Extensions.Logging;
+
+
+ public static class LogContextExtensions
+ {
+ public static void LogDebug(this ILogContext logContext, string message, params object[] args)
+ {
+ logContext?.Logger?.LogDebug(message, args);
+ }
+
+ public static void LogDebug(this ILogContext logContext, Exception exception, string message, params object[] args)
+ {
+ logContext?.Logger?.LogDebug(0, exception, message, args);
+ }
+
+ public static void LogInformation(this ILogContext logContext, string message, params object[] args)
+ {
+ logContext?.Logger?.LogInformation(message, args);
+ }
+
+ public static void LogInformation(this ILogContext logContext, Exception exception, string message, params object[] args)
+ {
+ logContext?.Logger?.LogInformation(0, exception, message, args);
+ }
+
+ public static void LogWarning(this ILogContext logContext, string message, params object[] args)
+ {
+ logContext?.Logger?.LogWarning(message, args);
+ }
+
+ public static void LogWarning(this ILogContext logContext, Exception exception, string message, params object[] args)
+ {
+ logContext?.Logger?.LogWarning(0, exception, message, args);
+ }
+
+ public static void LogError(this ILogContext logContext, string message, params object[] args)
+ {
+ logContext?.Logger?.LogError(message, args);
+ }
+
+ public static void LogError(this ILogContext logContext, Exception exception, string message, params object[] args)
+ {
+ logContext?.Logger?.LogError(0, exception, message, args);
+ }
+ }
+}
Index: src/MassTransit.Futures.Tests/ServiceEndpoint_Specs.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Futures.Tests/ServiceEndpoint_Specs.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Futures.Tests/ServiceEndpoint_Specs.cs (date 1568023835469)
@@ -358,7 +358,7 @@
{
public async Task Consume(ConsumeContext<DeployPayload> context)
{
- LogContext.Info?.Log("Deploying Payload: {Target}", context.Message.Target);
+ LogContext.LogInformation("Deploying Payload: {Target}", context.Message.Target);
await context.RespondAsync<PayloadDeployed>(new { });
}
Index: src/MassTransit/Conductor/Consumers/LinkConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Conductor/Consumers/LinkConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Conductor/Consumers/LinkConsumer.cs (date 1568023295241)
@@ -19,7 +19,7 @@
public async Task Consume(ConsumeContext<Link<T>> context)
{
- LogContext.Debug?.Log("Linking Client: {Id}", context.Message.ClientId);
+ LogContext.LogDebug("Linking Client: {Id}", context.Message.ClientId);
await _messageEndpoint.Link(context.Message.ClientId, context.SourceAddress).ConfigureAwait(false);
Index: src/MassTransit.RabbitMqTransport/Management/SetPrefetchCountManagementConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Management/SetPrefetchCountManagementConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Management/SetPrefetchCountManagementConsumer.cs (date 1568023405962)
@@ -40,11 +40,11 @@
context.Message.PrefetchCount
}).ConfigureAwait(false);
- LogContext.Debug?.Log("Set Prefetch Count: (queue: {QueueName}, count: {PrefetchCount})", _queueName, context.Message.PrefetchCount);
+ LogContext.LogDebug("Set Prefetch Count: (queue: {QueueName}, count: {PrefetchCount})", _queueName, context.Message.PrefetchCount);
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Set Prefetch Count failed: (queue: {QueueName}, count: {PrefetchCount})", _queueName,
+ LogContext.LogError(exception, "Set Prefetch Count failed: (queue: {QueueName}, count: {PrefetchCount})", _queueName,
context.Message.PrefetchCount);
throw;
Index: src/MassTransit.Futures.Tests/LinkService_Specs.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Futures.Tests/LinkService_Specs.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Futures.Tests/LinkService_Specs.cs (date 1568023835444)
@@ -323,7 +323,7 @@
{
public Task Consume(ConsumeContext<DeployPayload> context)
{
- LogContext.Info?.Log("Deploying Payload: {Target}", context.Message.Target);
+ LogContext.LogInformation("Deploying Payload: {Target}", context.Message.Target);
return context.RespondAsync<PayloadDeployed>(new
{
Index: src/MassTransit.RabbitMqTransport/Integration/ConnectionContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Integration/ConnectionContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Integration/ConnectionContextFactory.cs (date 1568023295430)
@@ -76,7 +76,7 @@
if (supervisor.Stopping.IsCancellationRequested)
throw new OperationCanceledException($"The connection is stopping and cannot be used: {_description}");
- LogContext.Debug?.Log("Connecting: {Host}", _description);
+ LogContext.LogDebug("Connecting: {Host}", _description);
if (_configuration.Settings.ClusterMembers?.Any() ?? false)
{
@@ -89,7 +89,7 @@
connection = _connectionFactory.Value.CreateConnection(hostNames, _configuration.Settings.ClientProvidedName);
}
- LogContext.Debug?.Log("Connected: {Host} (address: {RemoteAddress}, local: {LocalAddress})", _description, connection.Endpoint,
+ LogContext.LogDebug("Connected: {Host} (address: {RemoteAddress}, local: {LocalAddress})", _description, connection.Endpoint,
connection.LocalPort);
var connectionContext = new RabbitMqConnectionContext(connection, _configuration, _description, supervisor.Stopped);
@@ -100,7 +100,7 @@
}
catch (ConnectFailureException ex)
{
- LogContext.Debug?.Log(ex, "RabbitMQ Connect failed: {Host}", _description);
+ LogContext.LogDebug(ex, "RabbitMQ Connect failed: {Host}", _description);
connection?.Dispose();
@@ -108,7 +108,7 @@
}
catch (BrokerUnreachableException ex)
{
- LogContext.Debug?.Log(ex, "RabbitMQ unreachable: {Host}", _description);
+ LogContext.LogDebug(ex, "RabbitMQ unreachable: {Host}", _description);
connection?.Dispose();
@@ -116,7 +116,7 @@
}
catch (OperationInterruptedException ex)
{
- LogContext.Debug?.Log(ex, "RabbitMQ operation interrupted: {Host}", _description);
+ LogContext.LogDebug(ex, "RabbitMQ operation interrupted: {Host}", _description);
connection?.Dispose();
Index: src/MassTransit.WebJobs.EventHubsIntegration/EventHubSendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.WebJobs.EventHubsIntegration/EventHubSendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.WebJobs.EventHubsIntegration/EventHubSendTransport.cs (date 1568023295512)
@@ -87,7 +87,7 @@
protected override Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping Transport: {Address}", _address);
+ LogContext.LogDebug("Stopping Transport: {Address}", _address);
return base.StopSupervisor(context);
}
Index: src/MassTransit/MassTransit.csproj
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/MassTransit.csproj (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/MassTransit.csproj (date 1568024124251)
@@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Automatonymous" Version="4.1.6"/>
+ <PackageReference Include="Automatonymous" Version="4.1.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.0.2" />
<PackageReference Include="NewId" Version="3.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
Index: src/MassTransit.RabbitMqTransport/Integration/ModelContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Integration/ModelContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Integration/ModelContextFactory.cs (date 1568023295528)
@@ -103,7 +103,7 @@
{
var modelContext = await context.CreateModelContext(_cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Created model: {ChannelNumber} {Host}", modelContext.Model.ChannelNumber, context.Description);
+ LogContext.LogDebug("Created model: {ChannelNumber} {Host}", modelContext.Model.ChannelNumber, context.Description);
await _asyncContext.Created(modelContext).ConfigureAwait(false);
Index: src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributePublishTransportProvider.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributePublishTransportProvider.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributePublishTransportProvider.cs (date 1568023295521)
@@ -39,7 +39,7 @@
IAsyncCollector<Message> collector = await _binder.BindAsync<IAsyncCollector<Message>>(serviceBusTopic, _cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Creating Publish Transport: {Topic}", queueOrTopicName);
+ LogContext.LogDebug("Creating Publish Transport: {Topic}", queueOrTopicName);
var client = new CollectorMessageSendEndpointContext(queueOrTopicName, collector, _cancellationToken);
Index: src/MassTransit/Testing/BusTestHarness.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Testing/BusTestHarness.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Testing/BusTestHarness.cs (date 1568023406095)
@@ -161,7 +161,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Stop bus faulted");
+ LogContext.LogError(ex, "Stop bus faulted");
throw;
}
finally
Index: src/MassTransit/Testing/Observers/TestReceiveEndpointObserver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Testing/Observers/TestReceiveEndpointObserver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Testing/Observers/TestReceiveEndpointObserver.cs (date 1568023295335)
@@ -29,7 +29,7 @@
public Task Ready(ReceiveEndpointReady ready)
{
- LogContext.Debug?.Log("Endpoint Ready: {InputAddress}", ready.InputAddress);
+ LogContext.LogDebug("Endpoint Ready: {InputAddress}", ready.InputAddress);
ready.ReceiveEndpoint.ConnectPublishObserver(_publishObserver);
@@ -43,7 +43,7 @@
public Task Completed(ReceiveEndpointCompleted completed)
{
- LogContext.Debug?.Log("Endpoint Complete: {DeliveryCount}/{ConcurrentDeliveryCount} {InputAddress}", completed.DeliveryCount,
+ LogContext.LogDebug("Endpoint Complete: {DeliveryCount}/{ConcurrentDeliveryCount} {InputAddress}", completed.DeliveryCount,
completed.ConcurrentDeliveryCount, completed.InputAddress);
return TaskUtil.Completed;
@@ -51,7 +51,7 @@
public Task Faulted(ReceiveEndpointFaulted faulted)
{
- LogContext.Debug?.Log("Endpoint Faulted: {Exception} {InputAddress}", faulted.Exception, faulted.InputAddress);
+ LogContext.LogDebug("Endpoint Faulted: {Exception} {InputAddress}", faulted.Exception, faulted.InputAddress);
return TaskUtil.Completed;
}
Index: src/MassTransit.AzureServiceBusTransport/Transport/BrokeredMessageReceiver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Transport/BrokeredMessageReceiver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Transport/BrokeredMessageReceiver.cs (date 1568023394771)
@@ -89,7 +89,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Abandon message faulted: {MessageId", message.MessageId);
+ LogContext.LogWarning(exception, "Abandon message faulted: {MessageId", message.MessageId);
}
await _receiveEndpointContext.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
Index: src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributeSendTransportProvider.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributeSendTransportProvider.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.WebJobs.ServiceBusIntegration/ServiceBusAttributeSendTransportProvider.cs (date 1568023295390)
@@ -34,7 +34,7 @@
IAsyncCollector<Message> collector = await _binder.BindAsync<IAsyncCollector<Message>>(serviceBusQueue, _cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Creating Send Transport: {Queue}", queueOrTopicName);
+ LogContext.LogDebug("Creating Send Transport: {Queue}", queueOrTopicName);
var sendEndpointContext = new CollectorMessageSendEndpointContext(queueOrTopicName, collector, _cancellationToken);
Index: src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaConsumeContext.cs (date 1568023295260)
@@ -31,7 +31,7 @@
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
Index: src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Saga/MessageSessionSagaRepository.cs (date 1568023905581)
@@ -37,8 +37,7 @@
if (Guid.TryParse(sessionContext.SessionId, out var sessionId))
context = new CorrelationIdConsumeContextProxy<T>(context, sessionId);
- var activity = LogContext.IfEnabled(OperationName.Saga.Send)?.StartActivity(new {context.CorrelationId});
- try
+ using (var activity = LogContext.StartActivity(OperationName.Saga.Send, new {context.CorrelationId}))
{
var saga = await ReadSagaState(sessionContext).ConfigureAwait(false);
if (saga == null)
@@ -51,7 +50,7 @@
{
SagaConsumeContext<TSaga, T> sagaConsumeContext = new MessageSessionSagaConsumeContext<TSaga, T>(context, sessionContext, saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.CorrelationId, TypeMetadataCache<T>.ShortName);
await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
@@ -60,15 +59,11 @@
{
await WriteSagaState(sessionContext, saga).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Updated {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Updated {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.CorrelationId, TypeMetadataCache<T>.ShortName);
}
}
}
- finally
- {
- activity?.Stop();
- }
}
Task ISagaRepository<TSaga>.SendQuery<T>(SagaQueryConsumeContext<TSaga, T> context, ISagaPolicy<TSaga, T> policy,
@@ -147,7 +142,7 @@
var proxy = new MessageSessionSagaConsumeContext<TSaga, TMessage>(context, sessionContext, context.Saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
try
@@ -158,13 +153,13 @@
{
await _writeSagaState(sessionContext, proxy.Saga).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Saved {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Saved {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
}
}
catch (Exception)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
throw;
Index: src/MassTransit.Azure.ServiceBus.Core/Hosting/ServiceBusHostBusFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Hosting/ServiceBusHostBusFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Hosting/ServiceBusHostBusFactory.cs (date 1568023835425)
@@ -50,7 +50,7 @@
}
});
- LogContext.Info?.Log("Configuring Host: {Host}", hostSettings.ServiceUri);
+ LogContext.LogInformation("Configuring Host: {Host}", hostSettings.ServiceUri);
var serviceConfigurator = new ServiceBusServiceConfigurator(configurator, host);
Index: src/MassTransit.AzureServiceBusTransport/Transport/ServiceBusSendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Transport/ServiceBusSendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Transport/ServiceBusSendTransport.cs (date 1568023394741)
@@ -61,7 +61,7 @@
protected override Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping send transport: {Address}", _address);
+ LogContext.LogDebug("Stopping send transport: {Address}", _address);
return base.StopSupervisor(context);
}
@@ -137,7 +137,7 @@
var enqueueTimeUtc = context.ScheduledEnqueueTimeUtc.Value;
if (enqueueTimeUtc < now)
{
- LogContext.Debug?.Log("The scheduled time was in the past, sending: {ScheduledTime}", context.ScheduledEnqueueTimeUtc);
+ LogContext.LogDebug("The scheduled time was in the past, sending: {ScheduledTime}", context.ScheduledEnqueueTimeUtc);
return false;
}
@@ -156,7 +156,7 @@
}
catch (ArgumentOutOfRangeException)
{
- LogContext.Debug?.Log("The scheduled time was rejected by the server, sending: {MessageId}", context.MessageId);
+ LogContext.LogDebug("The scheduled time was rejected by the server, sending: {MessageId}", context.MessageId);
return false;
}
@@ -168,11 +168,11 @@
{
await clientContext.CancelScheduledSend(sequenceNumber).ConfigureAwait(false);
- LogContext.Debug?.Log("Canceled scheduled message {SequenceNumber} {EntityPath}", sequenceNumber, clientContext.EntityPath);
+ LogContext.LogDebug("Canceled scheduled message {SequenceNumber} {EntityPath}", sequenceNumber, clientContext.EntityPath);
}
catch (MessageNotFoundException exception)
{
- LogContext.Warning?.Log(exception, "The scheduled message was not found: {SequenceNumber} {EntityPath}", sequenceNumber,
+ LogContext.LogWarning(exception, "The scheduled message was not found: {SequenceNumber} {EntityPath}", sequenceNumber,
clientContext.EntityPath);
}
}
Index: src/MassTransit.WebJobs.ServiceBusIntegration/Contexts/CollectorMessageSendEndpointContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.WebJobs.ServiceBusIntegration/Contexts/CollectorMessageSendEndpointContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.WebJobs.ServiceBusIntegration/Contexts/CollectorMessageSendEndpointContext.cs (date 1568023295268)
@@ -40,14 +40,14 @@
public Task Send(Message message)
{
- LogContext.Debug?.Log("Sending message: {MessageId}", message.MessageId);
+ LogContext.LogDebug("Sending message: {MessageId}", message.MessageId);
return _collector.AddAsync(message, _cancellationToken);
}
public async Task<long> ScheduleSend(Message message, DateTime scheduleEnqueueTimeUtc)
{
- LogContext.Debug?.Log("Scheduling message: {MessageId} for delivery at {ScheduledTime}", message.MessageId, scheduleEnqueueTimeUtc);
+ LogContext.LogDebug("Scheduling message: {MessageId} for delivery at {ScheduledTime}", message.MessageId, scheduleEnqueueTimeUtc);
message.ScheduledEnqueueTimeUtc = scheduleEnqueueTimeUtc;
Index: src/MassTransit.HttpTransport/Clients/HttpClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.HttpTransport/Clients/HttpClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.HttpTransport/Clients/HttpClientContext.cs (date 1568023405968)
@@ -58,11 +58,11 @@
_client.Dispose();
- LogContext.Debug?.Log("Closed client: {Host}", _client.BaseAddress);
+ LogContext.LogDebug("Closed client: {Host}", _client.BaseAddress);
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Failed to close client: {Host}", _client.BaseAddress);
+ LogContext.LogError(ex, "Failed to close client: {Host}", _client.BaseAddress);
}
return TaskUtil.Completed;
Index: src/MassTransit.ActiveMqTransport/Transport/ActiveMqSendTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Transport/ActiveMqSendTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Transport/ActiveMqSendTransport.cs (date 1568023866569)
@@ -61,7 +61,7 @@
protected override Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping send transport: {EntityName}", _context.EntityName);
+ LogContext.LogDebug("Stopping send transport: {EntityName}", _context.EntityName);
return base.StopSupervisor(context);
}
@@ -95,62 +95,60 @@
var context = new TransportActiveMqSendContext<T>(_message, _cancellationToken);
- var activity = LogContext.IfEnabled(OperationName.Transport.Send)?.StartActivity(new
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Send, new
{
_context.EntityName,
_context.DestinationType
- });
- try
- {
- await _pipe.Send(context).ConfigureAwait(false);
+ }))
+ {
+ try
+ {
+ await _pipe.Send(context).ConfigureAwait(false);
- activity.AddSendContextHeaders(context);
+ activity.AddSendContextHeaders(context);
- byte[] body = context.Body;
+ byte[] body = context.Body;
- var transportMessage = sessionContext.Session.CreateBytesMessage();
+ var transportMessage = sessionContext.Session.CreateBytesMessage();
- transportMessage.Properties.SetHeaders(context.Headers);
+ transportMessage.Properties.SetHeaders(context.Headers);
- transportMessage.Properties["Content-Type"] = context.ContentType.MediaType;
+ transportMessage.Properties["Content-Type"] = context.ContentType.MediaType;
- transportMessage.NMSDeliveryMode = context.Durable ? MsgDeliveryMode.Persistent : MsgDeliveryMode.NonPersistent;
+ transportMessage.NMSDeliveryMode = context.Durable ? MsgDeliveryMode.Persistent : MsgDeliveryMode.NonPersistent;
- if (context.MessageId.HasValue)
- transportMessage.NMSMessageId = context.MessageId.ToString();
+ if (context.MessageId.HasValue)
+ transportMessage.NMSMessageId = context.MessageId.ToString();
- if (context.CorrelationId.HasValue)
- transportMessage.NMSCorrelationID = context.CorrelationId.ToString();
+ if (context.CorrelationId.HasValue)
+ transportMessage.NMSCorrelationID = context.CorrelationId.ToString();
- if (context.TimeToLive.HasValue)
- transportMessage.NMSTimeToLive = context.TimeToLive.Value;
+ if (context.TimeToLive.HasValue)
+ transportMessage.NMSTimeToLive = context.TimeToLive.Value;
- if (context.Priority.HasValue)
- transportMessage.NMSPriority = context.Priority.Value;
+ if (context.Priority.HasValue)
+ transportMessage.NMSPriority = context.Priority.Value;
- transportMessage.Content = body;
+ transportMessage.Content = body;
- await _context.SendObservers.PreSend(context).ConfigureAwait(false);
+ await _context.SendObservers.PreSend(context).ConfigureAwait(false);
- var publishTask = Task.Run(() => producer.Send(transportMessage), context.CancellationToken);
+ var publishTask = Task.Run(() => producer.Send(transportMessage), context.CancellationToken);
- await publishTask.UntilCompletedOrCanceled(context.CancellationToken).ConfigureAwait(false);
+ await publishTask.UntilCompletedOrCanceled(context.CancellationToken).ConfigureAwait(false);
- context.LogSent();
+ context.LogSent();
- await _context.SendObservers.PostSend(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- context.LogFaulted(ex);
+ await _context.SendObservers.PostSend(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ context.LogFaulted(ex);
- await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
+ await _context.SendObservers.SendFault(context, ex).ConfigureAwait(false);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Contexts/SubscriptionClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Contexts/SubscriptionClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Contexts/SubscriptionClientContext.cs (date 1568023394612)
@@ -43,18 +43,18 @@
public async Task CloseAsync(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Closing client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closing client: {InputAddress}", InputAddress);
try
{
if (_subscriptionClient != null && !_subscriptionClient.IsClosedOrClosing)
await _subscriptionClient.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closed client: {InputAddress}", InputAddress);
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Close client faulted: {InputAddress}", InputAddress);
+ LogContext.LogWarning(exception, "Close client faulted: {InputAddress}", InputAddress);
}
}
Index: src/MassTransit.AzureServiceBusTransport/Transport/Receiver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Transport/Receiver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Transport/Receiver.cs (date 1568023406152)
@@ -64,11 +64,11 @@
protected void ExceptionHandler(object sender, ExceptionReceivedEventArgs args)
{
if (!(args.Exception is OperationCanceledException))
- LogContext.Error?.Log(args.Exception, "Exception on Receiver {InputAddress} during {Action}", _context.InputAddress, args.Action);
+ LogContext.LogError(args.Exception, "Exception on Receiver {InputAddress} during {Action}", _context.InputAddress, args.Action);
if (_tracker.ActiveDeliveryCount == 0)
{
- LogContext.Debug?.Log("Receiver shutdown completed: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Receiver shutdown completed: {InputAddress}", _context.InputAddress);
_deliveryComplete.TrySetResult(true);
@@ -86,7 +86,7 @@
protected override async Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping receiver: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Stopping receiver: {InputAddress}", _context.InputAddress);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -104,7 +104,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
}
}
@@ -138,7 +138,7 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/MassTransit.ActiveMqTransport/Transport/ActiveMqReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Transport/ActiveMqReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Transport/ActiveMqReceiveTransport.cs (date 1568023406109)
@@ -110,7 +110,7 @@
async Task<ActiveMqConnectException> ConvertToActiveMqConnectionException(Exception ex, string message)
{
- LogContext.Error?.Log(ex, message);
+ LogContext.LogError(ex, message);
var exception = new ActiveMqConnectException(message + _host.ConnectionContextSupervisor, ex);
@@ -121,7 +121,7 @@
Task NotifyFaulted(Exception exception)
{
- LogContext.Error?.Log(exception, "ActiveMQ Connect Failed: {Host}", _host.Settings.ToDescription());
+ LogContext.LogError(exception, "ActiveMQ Connect Failed: {Host}", _host.Settings.ToDescription());
return _receiveEndpointContext.TransportObservers.Faulted(new ReceiveTransportFaultedEvent(_inputAddress, exception));
}
Index: src/MassTransit.AzureServiceBusTransport/Transport/MessageSessionAsyncHandler.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Transport/MessageSessionAsyncHandler.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Transport/MessageSessionAsyncHandler.cs (date 1568023406065)
@@ -59,14 +59,14 @@
public Task OnCloseSessionAsync(MessageSession session)
{
- LogContext.Debug?.Log("Session closed: {SessionId} ({InputAddress})", session.SessionId, _context.InputAddress);
+ LogContext.LogDebug("Session closed: {SessionId} ({InputAddress})", session.SessionId, _context.InputAddress);
return TaskUtil.Completed;
}
public Task OnSessionLostAsync(Exception exception)
{
- LogContext.Debug?.Log("Session lost: {SessionId} ({InputAddress})", _session.SessionId, _context.InputAddress);
+ LogContext.LogDebug("Session lost: {SessionId} ({InputAddress})", _session.SessionId, _context.InputAddress);
return TaskUtil.Completed;
}
@@ -81,7 +81,7 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(exception, "Abandon message faulted during shutdown: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/MassTransit.RabbitMqTransport.Tests/DelayRetry_Specs.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport.Tests/DelayRetry_Specs.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport.Tests/DelayRetry_Specs.cs (date 1568023835438)
@@ -246,7 +246,7 @@
public Consumer()
{
- LogContext.Info?.Log("Creating consumer");
+ LogContext.LogInformation("Creating consumer");
}
public Task Consume(ConsumeContext<PingMessage> context)
Index: src/MassTransit.AzureServiceBusTransport/Transport/ReceiveTransport.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Transport/ReceiveTransport.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Transport/ReceiveTransport.cs (date 1568023406137)
@@ -104,7 +104,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Receive transport faulted: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(ex, "Receive transport faulted: {InputAddress}", _context.InputAddress);
await _context.TransportObservers.Faulted(new ReceiveTransportFaultedEvent(inputAddress, ex)).ConfigureAwait(false);
Index: src/MassTransit.AzureServiceBusTransport.Tests/TwoScopeAzureServiceBusTestFixture.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport.Tests/TwoScopeAzureServiceBusTestFixture.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport.Tests/TwoScopeAzureServiceBusTestFixture.cs (date 1568023406125)
@@ -105,7 +105,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SecondBus Stop failed");
+ LogContext.LogError(ex, "SecondBus Stop failed");
}
finally
{
Index: src/MassTransit.ActiveMqTransport/Transport/ConnectionContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Transport/ConnectionContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Transport/ConnectionContextFactory.cs (date 1568023405854)
@@ -66,13 +66,13 @@
if (supervisor.Stopping.IsCancellationRequested)
throw new OperationCanceledException($"The connection is stopping and cannot be used: {_configuration.Description}");
- LogContext.Debug?.Log("Connecting: {Host}", _configuration.Description);
+ LogContext.LogDebug("Connecting: {Host}", _configuration.Description);
connection = _configuration.Settings.CreateConnection();
connection.Start();
- LogContext.Debug?.Log("Connected: {Host} (client-id: {ClientId}, version: {Version})", _configuration.Description, connection.ClientId,
+ LogContext.LogDebug("Connected: {Host} (client-id: {ClientId}, version: {Version})", _configuration.Description, connection.ClientId,
connection.MetaData.NMSVersion);
var connectionContext = new ActiveMqConnectionContext(connection, _configuration, supervisor.Stopped);
@@ -88,7 +88,7 @@
}
catch (NMSConnectionException ex)
{
- LogContext.Error?.Log(ex, "ActiveMQ connection failed");
+ LogContext.LogError(ex, "ActiveMQ connection failed");
await asyncContext.CreateFaulted(ex).ConfigureAwait(false);
Index: src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaRepository.cs (date 1568023406208)
@@ -164,7 +164,7 @@
}
else
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new EntityFrameworkSagaConsumeContext<TSaga, T>(dbContext, context, instance);
@@ -184,7 +184,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -197,7 +197,7 @@
}
else
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
try
@@ -206,7 +206,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
}
@@ -214,7 +214,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
try
@@ -223,7 +223,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -352,7 +352,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -371,7 +371,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
}
@@ -379,7 +379,7 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
try
{
@@ -387,7 +387,7 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
throw;
@@ -400,10 +400,10 @@
}
catch (Exception innerException)
{
- LogContext.Warning?.Log(innerException, "Transaction rollback failed");
+ LogContext.LogWarning(innerException, "Transaction rollback failed");
}
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
}
@@ -424,7 +424,7 @@
entry = dbContext.Set<TSaga>().Add(instance);
await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
return true;
@@ -436,7 +436,7 @@
// see here for details: https://www.davideguida.com/how-to-reset-the-entities-state-on-a-entity-framework-db-context/
entry.State = EntityState.Detached;
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
@@ -449,7 +449,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new EntityFrameworkSagaConsumeContext<TSaga, T>(dbContext, context, instance);
@@ -501,7 +501,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
var proxy = new EntityFrameworkSagaConsumeContext<TSaga, TMessage>(_dbContext, context, context.Saga, false);
Index: src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.EntityFrameworkCoreIntegration/Saga/EntityFrameworkSagaConsumeContext.cs (date 1568023295414)
@@ -46,7 +46,7 @@
{
_dbContext.Set<TSaga>().Remove(Saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
await _dbContext.SaveChangesAsync(CancellationToken).ConfigureAwait(false);
Index: src/MassTransit.ActiveMqTransport/Transport/SessionContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.ActiveMqTransport/Transport/SessionContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.ActiveMqTransport/Transport/SessionContextFactory.cs (date 1568023406117)
@@ -49,7 +49,7 @@
{
var session = await connectionContext.CreateSession(cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Created session: {Host}", connectionContext.Description);
+ LogContext.LogDebug("Created session: {Host}", connectionContext.Description);
var sessionContext = new ActiveMqSessionContext(connectionContext, session, cancellationToken);
@@ -79,7 +79,7 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Create session failed: {Host}", connectionContext.Description);
+ LogContext.LogError(exception, "Create session failed: {Host}", connectionContext.Description);
await asyncContext.CreateFaulted(exception).ConfigureAwait(false);
}
Index: src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusNamespaceContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusNamespaceContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusNamespaceContext.cs (date 1568023294872)
@@ -27,7 +27,7 @@
public Task DisposeAsync(CancellationToken cancellationToken = new CancellationToken())
{
- LogContext.Debug?.Log("Closed namespace manager: {Host}", _namespaceManager.Address);
+ LogContext.LogDebug("Closed namespace manager: {Host}", _namespaceManager.Address);
return TaskUtil.Completed;
}
@@ -46,7 +46,7 @@
{
try
{
- LogContext.Debug?.Log("Creating queue {Queue}", queueDescription.Path);
+ LogContext.LogDebug("Creating queue {Queue}", queueDescription.Path);
queueDescription = await _namespaceManager.CreateQueueAsync(queueDescription).ConfigureAwait(false);
}
@@ -56,7 +56,7 @@
}
}
- LogContext.Debug?.Log("Queue: {Queue} ({Attributes})", queueDescription.Path,
+ LogContext.LogDebug("Queue: {Queue} ({Attributes})", queueDescription.Path,
string.Join(", ",
new[]
{
@@ -80,7 +80,7 @@
{
try
{
- LogContext.Debug?.Log("Creating topic {Topic}", topicDescription.Path);
+ LogContext.LogDebug("Creating topic {Topic}", topicDescription.Path);
topicDescription = await _namespaceManager.CreateTopicAsync(topicDescription).ConfigureAwait(false);
}
@@ -90,7 +90,7 @@
}
}
- LogContext.Debug?.Log("Topic: {Topic} ({Attributes})", topicDescription.Path,
+ LogContext.LogDebug("Topic: {Topic} ({Attributes})", topicDescription.Path,
string.Join(", ", new[]
{
topicDescription.RequiresDuplicateDetection ? "dupe detect" : "",
@@ -124,7 +124,7 @@
if (!targetForwardTo.Equals(currentForwardTo))
{
- LogContext.Debug?.Log("Updating subscription: {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.SubscriptionName,
+ LogContext.LogDebug("Updating subscription: {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.SubscriptionName,
subscriptionDescription.TopicPath, subscriptionDescription.ForwardTo);
await _namespaceManager.UpdateSubscriptionAsync(description).ConfigureAwait(false);
@@ -136,7 +136,7 @@
.ConfigureAwait(false);
if (rule.Name == ruleDescription.Name && (rule.Filter != ruleDescription.Filter || rule.Action != ruleDescription.Action))
{
- LogContext.Debug?.Log("Updating subscription Rule: {Rule} ({DescriptionFilter} -> {Filter})", rule.Name,
+ LogContext.LogDebug("Updating subscription Rule: {Rule} ({DescriptionFilter} -> {Filter})", rule.Name,
ruleDescription.Filter.ToString(), rule.Filter.ToString());
await _namespaceManager.UpdateRuleAsync(description.TopicPath, description.SubscriptionName, rule).ConfigureAwait(false);
@@ -154,7 +154,7 @@
var created = false;
try
{
- LogContext.Debug?.Log("Creating subscription {Subscription} {Topic} -> {ForwardTo}", description.SubscriptionName, description.TopicPath,
+ LogContext.LogDebug("Creating subscription {Subscription} {Topic} -> {ForwardTo}", description.SubscriptionName, description.TopicPath,
description.ForwardTo);
subscriptionDescription = rule != null
@@ -174,7 +174,7 @@
.ConfigureAwait(false);
}
- LogContext.Debug?.Log("Subscription {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.SubscriptionName,
+ LogContext.LogDebug("Subscription {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.SubscriptionName,
subscriptionDescription.TopicPath, subscriptionDescription.ForwardTo);
return subscriptionDescription;
@@ -190,7 +190,7 @@
{
}
- LogContext.Debug?.Log("Subscription Deleted: {Subscription} ({Topic} -> {ForwardTo})", description.SubscriptionName, description.TopicPath,
+ LogContext.LogDebug("Subscription Deleted: {Subscription} ({Topic} -> {ForwardTo})", description.SubscriptionName, description.TopicPath,
description.ForwardTo);
}
}
Index: src/MassTransit/Configuration/Registration/Registration.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/Registration/Registration.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/Registration/Registration.cs (date 1568023294938)
@@ -189,7 +189,7 @@
if (endpoint.Consumers != null)
foreach (var consumer in endpoint.Consumers)
{
- LogContext.Debug?.Log("Configuring consumer {ConsumerType} on {Endpoint}", TypeMetadataCache.GetShortName(consumer.ConsumerType),
+ LogContext.LogDebug("Configuring consumer {ConsumerType} on {Endpoint}", TypeMetadataCache.GetShortName(consumer.ConsumerType),
endpoint.Name);
ConfigureConsumer(consumer.ConsumerType, cfg);
@@ -198,7 +198,7 @@
if (endpoint.Sagas != null)
foreach (var saga in endpoint.Sagas)
{
- LogContext.Debug?.Log("Configuring saga {SagaType} on {Endpoint}", TypeMetadataCache.GetShortName(saga.SagaType), endpoint.Name);
+ LogContext.LogDebug("Configuring saga {SagaType} on {Endpoint}", TypeMetadataCache.GetShortName(saga.SagaType), endpoint.Name);
ConfigureSaga(saga.SagaType, cfg);
}
@@ -213,10 +213,10 @@
{
configurator.ReceiveEndpoint(compensateDefinition, endpointNameFormatter, compensateEndpointConfigurator =>
{
- LogContext.Debug?.Log("Configuring receive endpoint {Endpoint}", ToEndpointString(compensateEndpointName,
+ LogContext.LogDebug("Configuring receive endpoint {Endpoint}", ToEndpointString(compensateEndpointName,
compensateDefinition));
- LogContext.Debug?.Log("Configuring activity {ActivityType} on {ExecuteEndpoint} / {CompensateEndpoint}",
+ LogContext.LogDebug("Configuring activity {ActivityType} on {ExecuteEndpoint} / {CompensateEndpoint}",
TypeMetadataCache.GetShortName(activity.ActivityType), endpoint.Name, compensateEndpointName);
ConfigureActivity(activity.ActivityType, cfg, compensateEndpointConfigurator);
@@ -226,7 +226,7 @@
{
configurator.ReceiveEndpoint(compensateEndpointName, compensateEndpointConfigurator =>
{
- LogContext.Debug?.Log("Configuring activity {ActivityType} on {ExecuteEndpoint} / {CompensateEndpoint}",
+ LogContext.LogDebug("Configuring activity {ActivityType} on {ExecuteEndpoint} / {CompensateEndpoint}",
TypeMetadataCache.GetShortName(activity.ActivityType), endpoint.Name, compensateEndpointName);
ConfigureActivity(activity.ActivityType, cfg, compensateEndpointConfigurator);
@@ -237,7 +237,7 @@
if (endpoint.ExecuteActivities != null)
foreach (var activity in endpoint.ExecuteActivities)
{
- LogContext.Debug?.Log("Configuring activity {ActivityType} on {ExecuteEndpoint}",
+ LogContext.LogDebug("Configuring activity {ActivityType} on {ExecuteEndpoint}",
TypeMetadataCache.GetShortName(activity.ActivityType), endpoint.Name);
ConfigureExecuteActivity(activity.ActivityType, cfg);
Index: src/MassTransit.HttpTransport/Contexts/KestrelHttpHostContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.HttpTransport/Contexts/KestrelHttpHostContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.HttpTransport/Contexts/KestrelHttpHostContext.cs (date 1568023406085)
@@ -51,7 +51,7 @@
public async Task Start(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Configuring WebHost: {Host}", _configuration.HostAddress);
+ LogContext.LogDebug("Configuring WebHost: {Host}", _configuration.HostAddress);
IPHostEntry entries = await Dns.GetHostEntryAsync(_configuration.Settings.Host).ConfigureAwait(false);
@@ -74,21 +74,21 @@
.Build();
}
- LogContext.Debug?.Log("Building WebHost: {Host}", _configuration.HostAddress);
+ LogContext.LogDebug("Building WebHost: {Host}", _configuration.HostAddress);
_webHost = BuildWebHost();
- LogContext.Debug?.Log("Starting WebHost: {Host}", _configuration.HostAddress);
+ LogContext.LogDebug("Starting WebHost: {Host}", _configuration.HostAddress);
try
{
await _webHost.StartAsync(cancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Started WebHost: {Host}", _configuration.HostAddress);
+ LogContext.LogDebug("Started WebHost: {Host}", _configuration.HostAddress);
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Fault starting WebHost: {Host}", _configuration.HostAddress);
+ LogContext.LogError(exception, "Fault starting WebHost: {Host}", _configuration.HostAddress);
throw;
}
@@ -101,7 +101,7 @@
if (_started)
throw new InvalidOperationException("The host has already been started, no additional endpoints may be added.");
- LogContext.Debug?.Log("Adding endpoint handler: {Match}", pathMatch);
+ LogContext.LogDebug("Adding endpoint handler: {Match}", pathMatch);
lock (_endpoints)
{
Index: src/MassTransit.Azure.ServiceBus.Core/Contexts/QueueClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Contexts/QueueClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Contexts/QueueClientContext.cs (date 1568023394626)
@@ -49,11 +49,11 @@
if (_queueClient != null && !_queueClient.IsClosedOrClosing)
await _queueClient.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closed client: {InputAddress}", InputAddress);
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Close client faulted: {InputAddress}", InputAddress);
+ LogContext.LogWarning(exception, "Close client faulted: {InputAddress}", InputAddress);
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusMessagingFactoryContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusMessagingFactoryContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Contexts/ServiceBusMessagingFactoryContext.cs (date 1568023295723)
@@ -25,7 +25,7 @@
{
await _messagingFactory.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed messaging factory: {Host}", _messagingFactory.Address);
+ LogContext.LogDebug("Closed messaging factory: {Host}", _messagingFactory.Address);
}
MessagingFactory MessagingFactoryContext.MessagingFactory => _messagingFactory;
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessageReceiverFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessageReceiverFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessageReceiverFilter.cs (date 1568023294746)
@@ -44,7 +44,7 @@
async Task IFilter<ClientContext>.Send(ClientContext context, IPipe<ClientContext> next)
{
- LogContext.Debug?.Log("Creating message receiver for {InputAddress}", context.InputAddress);
+ LogContext.LogDebug("Creating message receiver for {InputAddress}", context.InputAddress);
var receiver = CreateMessageReceiver(context, _messageReceiver);
@@ -66,7 +66,7 @@
await _transportObserver.Completed(new ReceiveTransportCompletedEvent(context.InputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", context.InputAddress,
+ LogContext.LogDebug("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", context.InputAddress,
metrics.DeliveryCount, metrics.ConcurrentDeliveryCount);
}
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/ConfigureTopologyFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/ConfigureTopologyFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/ConfigureTopologyFilter.cs (date 1568023394734)
@@ -45,7 +45,7 @@
}
catch (Exception ex)
{
- LogContext.Warning?.Log(ex, "Failed to remove one or more subscriptions from the endpoint.");
+ LogContext.LogWarning(ex, "Failed to remove one or more subscriptions from the endpoint.");
}
});
}).ConfigureAwait(false);
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessagingFactoryContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessagingFactoryContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/MessagingFactoryContextFactory.cs (date 1568023405894)
@@ -79,7 +79,7 @@
messagingFactory.RetryPolicy = _retryPolicy;
- LogContext.Debug?.Log("Connected: {Host}", _serviceUri);
+ LogContext.LogDebug("Connected: {Host}", _serviceUri);
var messagingFactoryContext = new ServiceBusMessagingFactoryContext(messagingFactory, supervisor.Stopped);
@@ -87,7 +87,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Connect failed: {Host}", _serviceUri);
+ LogContext.LogError(ex, "Connect failed: {Host}", _serviceUri);
throw;
}
Index: src/MassTransit.HttpTransport/Transport/HttpConsumerFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.HttpTransport/Transport/HttpConsumerFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.HttpTransport/Transport/HttpConsumerFilter.cs (date 1568023295038)
@@ -66,7 +66,7 @@
HttpConsumerMetrics metrics = consumer;
await _context.TransportObservers.Completed(new ReceiveTransportCompletedEvent(inputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", metrics.DeliveryCount,
+ LogContext.LogDebug("Consumer completed: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", metrics.DeliveryCount,
metrics.ConcurrentDeliveryCount);
}
}
Index: src/MassTransit/Turnout/JobServiceBusObserver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Turnout/JobServiceBusObserver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Turnout/JobServiceBusObserver.cs (date 1568023835486)
@@ -45,11 +45,11 @@
public async Task PostStart(IBus bus, Task<BusReady> busReady)
{
- LogContext.Debug?.Log("Job Service starting: {InputAddress}", _jobService.InputAddress);
+ LogContext.LogDebug("Job Service starting: {InputAddress}", _jobService.InputAddress);
await busReady.ConfigureAwait(false);
- LogContext.Info?.Log("Job Service started: {InputAddress}", _jobService.InputAddress);
+ LogContext.LogInformation("Job Service started: {InputAddress}", _jobService.InputAddress);
}
public Task StartFaulted(IBus bus, Exception exception)
@@ -59,11 +59,11 @@
public async Task PreStop(IBus bus)
{
- LogContext.Debug?.Log("Job Service shutting down: {InputAddress}", _jobService.InputAddress);
+ LogContext.LogDebug("Job Service shutting down: {InputAddress}", _jobService.InputAddress);
await _jobService.Stop().ConfigureAwait(false);
- LogContext.Info?.Log("Job Service shut down: {InputAddress}", _jobService.InputAddress);
+ LogContext.LogInformation("Job Service shut down: {InputAddress}", _jobService.InputAddress);
}
public Task PostStop(IBus bus)
Index: src/MassTransit.HttpTransport/Transport/HttpConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.HttpTransport/Transport/HttpConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.HttpTransport/Transport/HttpConsumer.cs (date 1568023394757)
@@ -106,7 +106,7 @@
protected override async Task StopAgent(StopContext context)
{
- LogContext.Debug?.Log("Stopping Consumer: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Stopping Consumer: {InputAddress}", _context.InputAddress);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -123,7 +123,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for consumer cancellation: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for consumer cancellation: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/MassTransit/Turnout/JobService.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Turnout/JobService.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Turnout/JobService.cs (date 1568023405844)
@@ -66,7 +66,7 @@
var check = new SuperviseJobCommand<T>(jobHandle.JobId, job, utcNow, jobHandle.Status);
- LogContext.Debug?.Log("Scheduled job supervision: {JobId} ({MessageType})", jobHandle.JobId, TypeMetadataCache<T>.ShortName);
+ LogContext.LogDebug("Scheduled job supervision: {JobId} ({MessageType})", jobHandle.JobId, TypeMetadataCache<T>.ShortName);
return context.ScheduleSend(_managementAddress, scheduledTime, check);
}
@@ -83,7 +83,7 @@
{
try
{
- LogContext.Debug?.Log("Cancelling job: {JobId}", jobHandle.JobId);
+ LogContext.LogDebug("Cancelling job: {JobId}", jobHandle.JobId);
await jobHandle.Cancel().ConfigureAwait(false);
@@ -93,7 +93,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Cancel job faulted: {JobId}", jobHandle.JobId);
+ LogContext.LogError(ex, "Cancel job faulted: {JobId}", jobHandle.JobId);
}
}
}
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/NamespaceContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/NamespaceContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/NamespaceContextFactory.cs (date 1568023405930)
@@ -75,7 +75,7 @@
var namespaceManager = new NamespaceManager(_serviceUri, _settings);
- LogContext.Debug?.Log("Created NamespaceManager: {ServiceUri}", _serviceUri);
+ LogContext.LogDebug("Created NamespaceManager: {ServiceUri}", _serviceUri);
var context = new ServiceBusNamespaceContext(namespaceManager, supervisor.Stopped);
@@ -83,7 +83,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Create NamespaceManager faulted: {ServiceUri}", _serviceUri);
+ LogContext.LogError(ex, "Create NamespaceManager faulted: {ServiceUri}", _serviceUri);
throw;
}
Index: src/MassTransit/Context/InMemorySagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/InMemorySagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Context/InMemorySagaConsumeContext.cs (date 1568023295631)
@@ -30,7 +30,7 @@
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/JoinContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/JoinContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/JoinContextFactory.cs (date 1568023394647)
@@ -110,7 +110,7 @@
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Join faulted");
+ LogContext.LogWarning(exception, "Join faulted");
}
}
Index: src/MassTransit/Turnout/JobRegistry.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Turnout/JobRegistry.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Turnout/JobRegistry.cs (date 1568023295234)
@@ -47,7 +47,7 @@
var removed = _jobs.TryRemove(jobId, out jobHandle);
if (removed)
{
- LogContext.Debug?.Log("Removed job: {JobId} ({JobStatus})", jobId, jobHandle.Status);
+ LogContext.LogDebug("Removed job: {JobId} ({JobStatus})", jobId, jobHandle.Status);
return true;
}
Index: src/MassTransit/Turnout/JobSupervisor.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Turnout/JobSupervisor.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Turnout/JobSupervisor.cs (date 1568023394597)
@@ -39,7 +39,7 @@
if (!_registry.TryGetJob(context.Message.JobId, out var jobHandle))
throw new JobNotFoundException($"The JobId {context.Message.JobId} was not found.");
- LogContext.Debug?.Log("Cancelling job: {JobId}", jobHandle.JobId);
+ LogContext.LogDebug("Cancelling job: {JobId}", jobHandle.JobId);
await jobHandle.Cancel().ConfigureAwait(false);
@@ -74,7 +74,7 @@
}
else
{
- LogContext.Warning?.Log("Cancelled job not found: {JobId}", context.Message.JobId);
+ LogContext.LogWarning("Cancelled job not found: {JobId}", context.Message.JobId);
}
}
}
Index: src/MassTransit/Context/ILogContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/ILogContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Context/ILogContext.cs (date 1568024637541)
@@ -8,6 +8,8 @@
/// </summary>
public interface ILogContext
{
+ ILogger Logger { get; }
+
/// <summary>
/// The log context for all message movement, sent, received, etc.
/// </summary>
@@ -17,8 +19,9 @@
/// If enabled, returns a valid source which can be used
/// </summary>
/// <param name="name"></param>
+ /// <param name="args"></param>
/// <returns>A valid source, or null</returns>
- EnabledDiagnosticSource? IfEnabled(string name);
+ IActivityScope BeginActivity(string name, object args = default);
/// <summary>
/// Creates a new ILogger instance using the full name of the given type.
@@ -32,14 +35,6 @@
/// <param name="categoryName">The category name for messages produced by the logger.</param>
/// <returns>The <see cref="T:Microsoft.Extensions.Logging.ILogger" />.</returns>
ILogContext CreateLogContext(string categoryName);
-
- EnabledLogger? IfEnabled(LogLevel level);
- EnabledLogger? Critical { get; }
- EnabledLogger? Debug { get; }
- EnabledLogger? Error { get; }
- EnabledLogger? Info { get; }
- EnabledLogger? Trace { get; }
- EnabledLogger? Warning { get; }
}
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/QueueSendEndpointContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/QueueSendEndpointContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/QueueSendEndpointContextFactory.cs (date 1568023295595)
@@ -23,7 +23,7 @@
protected override SendEndpointContext CreateClientContext(NamespaceContext leftContext, MessagingFactoryContext rightContext)
{
- LogContext.Debug?.Log("Creating Queue Client: {Queue}", _settings.EntityPath);
+ LogContext.LogDebug("Creating Queue Client: {Queue}", _settings.EntityPath);
var messageSender = rightContext.MessagingFactory.CreateMessageSender(_settings.EntityPath);
Index: src/MassTransit/Context/BaseLogContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/BaseLogContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Context/BaseLogContext.cs (date 1568024637553)
@@ -13,17 +13,14 @@
public BaseLogContext(ILogContext context)
{
- if (context == null)
- throw new ArgumentNullException(nameof(context));
-
- _context = context;
+ _context = context ?? throw new ArgumentNullException(nameof(context));
}
public ILogContext Messages => _context.Messages;
- public EnabledDiagnosticSource? IfEnabled(string name)
+ public IActivityScope BeginActivity(string name, object args = default)
{
- return _context.IfEnabled(name);
+ return _context.BeginActivity(name, args);
}
public ILogContext<T> CreateLogContext<T>()
@@ -36,39 +33,6 @@
return _context.CreateLogContext(categoryName);
}
- public EnabledLogger? IfEnabled(LogLevel level)
- {
- return _context.IfEnabled(level);
- }
-
- public EnabledLogger? Critical
- {
- get { return _context.Critical; }
- }
-
- public EnabledLogger? Debug
- {
- get { return _context.Debug; }
- }
-
- public EnabledLogger? Error
- {
- get { return _context.Error; }
- }
-
- public EnabledLogger? Info
- {
- get { return _context.Info; }
- }
-
- public EnabledLogger? Trace
- {
- get { return _context.Trace; }
- }
-
- public EnabledLogger? Warning
- {
- get { return _context.Warning; }
- }
+ public ILogger Logger => _context.Logger;
}
}
Index: src/MassTransit/Context/LogContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/LogContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Context/LogContext.cs (date 1568025188260)
@@ -24,13 +24,6 @@
Current = new BusLogContext(new SingleLoggerFactory(logger), source ?? Cached.Default.Value);
}
- public static ILogContext CreateLogContext(string categoryName)
- {
- var current = Current ?? (Current = CreateDefaultLogContext());
-
- return current.CreateLogContext(categoryName);
- }
-
public static void SetCurrentIfNull(ILogContext context)
{
if (Current == null)
@@ -42,15 +35,6 @@
return true;
}
- static ILogContext CreateDefaultLogContext()
- {
- var source = Cached.Default.Value;
-
- var loggerFactory = NullLoggerFactory.Instance;
-
- return new BusLogContext(loggerFactory, source);
- }
-
static class Cached
{
@@ -59,13 +43,64 @@
}
- public static EnabledDiagnosticSource? IfEnabled(string name) => Current?.IfEnabled(name);
+ class NoopActivityScope : IActivityScope
+ {
+ readonly string _operationName;
+ readonly Activity _current;
+
+ public NoopActivityScope(string operationName)
+ {
+ _operationName = operationName;
+ _current = new Activity(_operationName);
+ }
+
+ public void Dispose()
+ {
+ }
+
+ Activity IActivityScope.Current => _current;
+ }
+
+ public static IActivityScope StartActivity(string name, object args = null) => Current?.BeginActivity(name, args) ?? new NoopActivityScope(name);
- public static EnabledLogger? Critical => Current?.Critical;
- public static EnabledLogger? Debug => Current?.Debug;
- public static EnabledLogger? Error => Current?.Error;
- public static EnabledLogger? Info => Current?.Info;
- public static EnabledLogger? Trace => Current?.Trace;
- public static EnabledLogger? Warning => Current?.Warning;
+ public static void LogDebug(string message, params object[] args)
+ {
+ Current?.LogDebug(message, args);
+ }
+
+ public static void LogDebug(Exception exception, string message, params object[] args)
+ {
+ Current?.LogDebug(exception, message, args);
+ }
+
+ public static void LogInformation(string message, params object[] args)
+ {
+ Current?.LogInformation(message, args);
+ }
+
+ public static void LogInformation(Exception exception, string message, params object[] args)
+ {
+ Current?.LogInformation(exception, message, args);
+ }
+
+ public static void LogWarning(string message, params object[] args)
+ {
+ Current?.LogWarning(message, args);
+ }
+
+ public static void LogWarning(Exception exception, string message, params object[] args)
+ {
+ Current?.LogWarning(exception, message, args);
+ }
+
+ public static void LogError(string message, params object[] args)
+ {
+ Current?.LogError(message, args);
+ }
+
+ public static void LogError(Exception exception, string message, params object[] args)
+ {
+ Current?.LogError(exception, message, args);
+ }
}
}
Index: src/MassTransit.AmazonSqsTransport/Contexts/AmazonSqsClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Contexts/AmazonSqsClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Contexts/AmazonSqsClientContext.cs (date 1568023394880)
@@ -101,7 +101,7 @@
// required to preserve backwards compability
if (queue.EntityName.EndsWith(".fifo", true, CultureInfo.InvariantCulture) && !queue.QueueAttributes.ContainsKey(QueueAttributeName.FifoQueue))
{
- LogContext.Warning?.Log("Using '.fifo' suffix without 'FifoQueue' attribute might cause unexpected behavior.");
+ LogContext.LogWarning("Using '.fifo' suffix without 'FifoQueue' attribute might cause unexpected behavior.");
queue.QueueAttributes[QueueAttributeName.FifoQueue] = true;
}
Index: src/Persistence/MassTransit.RedisIntegration/RedisSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.RedisIntegration/RedisSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.RedisIntegration/RedisSagaConsumeContext.cs (date 1568023295224)
@@ -42,7 +42,7 @@
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
Index: src/MassTransit.Azure.ServiceBus.Core/Pipeline/TopicSendEndpointContextFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Pipeline/TopicSendEndpointContextFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Pipeline/TopicSendEndpointContextFactory.cs (date 1568023295283)
@@ -23,7 +23,7 @@
protected override SendEndpointContext CreateClientContext(NamespaceContext leftContext, MessagingFactoryContext rightContext)
{
- LogContext.Debug?.Log("Creating Topic Client: {Topic}", _settings.EntityPath);
+ LogContext.LogDebug("Creating Topic Client: {Topic}", _settings.EntityPath);
var messageSender = rightContext.MessagingFactory.CreateMessageSender(_settings.EntityPath);
Index: src/MassTransit/MassTransitBus.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/MassTransitBus.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/MassTransitBus.cs (date 1568023394724)
@@ -112,7 +112,7 @@
{
if (_busHandle != null)
{
- LogContext.Warning?.Log("StartAsync called, but the bus was already started: {Address} ({Reason})", Address, "Already Started");
+ LogContext.LogWarning("StartAsync called, but the bus was already started: {Address} ({Reason})", Address, "Already Started");
return _busHandle;
}
@@ -153,7 +153,7 @@
{
if (busHandle != null)
{
- LogContext.Debug?.Log("Bus start faulted, stopping hosts");
+ LogContext.LogDebug("Bus start faulted, stopping hosts");
await busHandle.StopAsync(cancellationToken).ConfigureAwait(false);
}
@@ -166,7 +166,7 @@
}
catch (Exception stopException)
{
- LogContext.Warning?.Log(stopException, "Bus start faulted, and failed to stop started hosts");
+ LogContext.LogWarning(stopException, "Bus start faulted, and failed to stop started hosts");
}
await _busObservable.StartFaulted(this, ex).ConfigureAwait(false);
@@ -183,7 +183,7 @@
{
if (_busHandle == null)
{
- LogContext.Warning?.Log("Failed to stop bus: {Address} ({Reason})", Address, "Not Started");
+ LogContext.LogWarning("Failed to stop bus: {Address} ({Reason})", Address, "Not Started");
return TaskUtil.Completed;
}
@@ -256,7 +256,7 @@
try
{
- LogContext.Debug?.Log("Stopping hosts");
+ LogContext.LogDebug("Stopping hosts");
await Task.WhenAll(_hostHandles.Select(x => x.Stop(cancellationToken))).ConfigureAwait(false);
@@ -266,7 +266,7 @@
{
await _busObserver.StopFaulted(_bus, exception).ConfigureAwait(false);
- LogContext.Warning?.Log(exception, "Bus stop faulted");
+ LogContext.LogWarning(exception, "Bus stop faulted");
throw;
}
Index: src/MassTransit/Context/BusLogContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Context/BusLogContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Context/BusLogContext.cs (date 1568024930156)
@@ -10,14 +10,13 @@
{
readonly DiagnosticSource _source;
readonly ILoggerFactory _loggerFactory;
- readonly Microsoft.Extensions.Logging.ILogger _logger;
readonly ILogContext _messageLogger;
public BusLogContext(ILoggerFactory loggerFactory, DiagnosticSource source)
{
_source = source;
_loggerFactory = loggerFactory;
- _logger = loggerFactory.CreateLogger(LogCategoryName.MassTransit);
+ Logger = loggerFactory.CreateLogger(LogCategoryName.MassTransit);
_messageLogger = new BusLogContext(source, loggerFactory, loggerFactory.CreateLogger("MassTransit.Messages"));
}
@@ -27,23 +26,23 @@
_source = source;
_loggerFactory = loggerFactory;
_messageLogger = messageLogger;
- _logger = logger;
+ Logger = logger;
}
BusLogContext(DiagnosticSource source, ILoggerFactory loggerFactory, Microsoft.Extensions.Logging.ILogger logger)
{
_source = source;
_loggerFactory = loggerFactory;
- _logger = logger;
+ Logger = logger;
_messageLogger = this;
}
ILogContext ILogContext.Messages => _messageLogger;
- public EnabledDiagnosticSource? IfEnabled(string name)
+ public IActivityScope BeginActivity(string name, object args = default)
{
- return _source.IsEnabled(name) ? new EnabledDiagnosticSource(_source, name) : default(EnabledDiagnosticSource?);
+ return new ActivityScope(_source, name, args);
}
public ILogContext<T> CreateLogContext<T>()
@@ -60,40 +59,7 @@
return new BusLogContext(_source, _loggerFactory, _messageLogger, logger);
}
- public EnabledLogger? IfEnabled(Microsoft.Extensions.Logging.LogLevel level)
- {
- return _logger.IsEnabled(level) ? new EnabledLogger(_logger, level) : default(EnabledLogger?);
- }
-
- public EnabledLogger? Critical
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Critical) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Critical) : default(EnabledLogger?); }
- }
-
- public EnabledLogger? Debug
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Debug) : default(EnabledLogger?); }
- }
-
- public EnabledLogger? Error
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Error) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Error) : default(EnabledLogger?); }
- }
-
- public EnabledLogger? Info
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Information) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Information) : default(EnabledLogger?); }
- }
-
- public EnabledLogger? Trace
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Trace) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Trace) : default(EnabledLogger?); }
- }
-
- public EnabledLogger? Warning
- {
- get { return _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Warning) ? new EnabledLogger(_logger, Microsoft.Extensions.Logging.LogLevel.Warning) : default(EnabledLogger?); }
- }
+ public ILogger Logger { get; }
}
Index: src/MassTransit.QuartzIntegration/ScheduleMessageConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.QuartzIntegration/ScheduleMessageConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.QuartzIntegration/ScheduleMessageConsumer.cs (date 1568023295568)
@@ -45,7 +45,7 @@
var jobKey = new JobKey(correlationId);
- LogContext.Debug?.Log("ScheduleMessage: {Id} at {ScheduledTime}", jobKey, context.Message.ScheduledTime);
+ LogContext.LogDebug("ScheduleMessage: {Id} at {ScheduledTime}", jobKey, context.Message.ScheduledTime);
var jobDetail = await CreateJobDetail(context, context.Message.Destination, jobKey).ConfigureAwait(false);
@@ -66,7 +66,7 @@
{
var jobKey = new JobKey(context.Message.Schedule.ScheduleId, context.Message.Schedule.ScheduleGroup);
- LogContext.Debug?.Log("Schedule recurring message: {Id}", jobKey);
+ LogContext.LogDebug("Schedule recurring message: {Id}", jobKey);
var jobDetail = await CreateJobDetail(context, context.Message.Destination, jobKey).ConfigureAwait(false);
Index: src/MassTransit.QuartzIntegration/CancelScheduledMessageConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.QuartzIntegration/CancelScheduledMessageConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.QuartzIntegration/CancelScheduledMessageConsumer.cs (date 1568023295437)
@@ -25,9 +25,9 @@
var deletedJob = await _scheduler.DeleteJob(jobKey, context.CancellationToken).ConfigureAwait(false);
if (deletedJob)
- LogContext.Debug?.Log("Cancelled Scheduled Message: {Id} at {Timestamp}", jobKey, context.Message.Timestamp);
+ LogContext.LogDebug("Cancelled Scheduled Message: {Id} at {Timestamp}", jobKey, context.Message.Timestamp);
else
- LogContext.Debug?.Log("CancelScheduledMessage: no message found for {Id}", jobKey);
+ LogContext.LogDebug("CancelScheduledMessage: no message found for {Id}", jobKey);
}
public async Task Consume(ConsumeContext<CancelScheduledRecurringMessage> context)
@@ -44,12 +44,12 @@
if (unscheduledJob)
{
- LogContext.Debug?.Log("CancelRecurringScheduledMessage: {ScheduleId}/{ScheduleGroup} at {Timestamp}", context.Message.ScheduleId,
+ LogContext.LogDebug("CancelRecurringScheduledMessage: {ScheduleId}/{ScheduleGroup} at {Timestamp}", context.Message.ScheduleId,
context.Message.ScheduleGroup, context.Message.Timestamp);
}
else
{
- LogContext.Debug?.Log("CancelRecurringScheduledMessage: no message found {ScheduleId}/{ScheduleGroup}", context.Message.ScheduleId,
+ LogContext.LogDebug("CancelRecurringScheduledMessage: no message found {ScheduleId}/{ScheduleGroup}", context.Message.ScheduleId,
context.Message.ScheduleGroup);
}
}
Index: src/Persistence/MassTransit.RedisIntegration/RedisSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.RedisIntegration/RedisSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.RedisIntegration/RedisSagaRepository.cs (date 1568023295501)
@@ -106,7 +106,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new RedisSagaConsumeContext<TSaga, T>(sagas, context, instance);
@@ -132,14 +132,14 @@
{
await sagas.Put(instance.CorrelationId, instance).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
return true;
}
catch (Exception ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
return false;
@@ -200,7 +200,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
SagaConsumeContext<TSaga, TMessage> proxy = new RedisSagaConsumeContext<TSaga, TMessage>(_sagas, context, context.Saga);
Index: src/MassTransit.AmazonSqsTransport/Pipeline/PurgeOnStartupFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Pipeline/PurgeOnStartupFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Pipeline/PurgeOnStartupFilter.cs (date 1568023294802)
@@ -49,13 +49,13 @@
{
await context.PurgeQueue(queueName, context.CancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("Purged queue {QueueName}", queueName);
+ LogContext.LogDebug("Purged queue {QueueName}", queueName);
_queueAlreadyPurged = true;
}
else
{
- LogContext.Debug?.Log("Queue {QueueName} was purged at startup, skipping", queueName);
+ LogContext.LogDebug("Queue {QueueName} was purged at startup, skipping", queueName);
}
}
}
Index: src/MassTransit.QuartzIntegration/ScheduledMessageJob.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.QuartzIntegration/ScheduledMessageJob.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.QuartzIntegration/ScheduledMessageJob.cs (date 1568023405955)
@@ -50,7 +50,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Failed to send scheduled message, type: {MessageType}, destination: {DestinationAddress}", MessageType, Destination);
+ LogContext.LogError(ex, "Failed to send scheduled message, type: {MessageType}, destination: {DestinationAddress}", MessageType, Destination);
throw new JobExecutionException(ex, context.RefireCount < 5);
}
Index: src/MassTransit/Monitoring/Performance/Windows/BaseWindowsPerformanceCounters.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Monitoring/Performance/Windows/BaseWindowsPerformanceCounters.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Monitoring/Performance/Windows/BaseWindowsPerformanceCounters.cs (date 1568023394635)
@@ -61,7 +61,7 @@
}
catch (SecurityException exception)
{
- LogContext.Warning?.Log(exception, "Unable to create performance counter category (Category: {Category})" +
+ LogContext.LogWarning(exception, "Unable to create performance counter category (Category: {Category})" +
"\nTry running the program in the Administrator role to set these up." +
"\n**Hey, this just means you aren't admin or don't have/want perf counter support**", _categoryName);
}
Index: src/MassTransit.AmazonSqsTransport/Pipeline/ConfigureTopologyFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Pipeline/ConfigureTopologyFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Pipeline/ConfigureTopologyFilter.cs (date 1568023295102)
@@ -84,35 +84,35 @@
Task Declare(ClientContext context, Topic topic)
{
- LogContext.Debug?.Log("Create topic {Topic}", topic);
+ LogContext.LogDebug("Create topic {Topic}", topic);
return context.CreateTopic(topic);
}
Task Declare(ClientContext context, QueueSubscription subscription)
{
- LogContext.Debug?.Log("Binding topic {Topic} to {Queue}", subscription.Source, subscription.Destination);
+ LogContext.LogDebug("Binding topic {Topic} to {Queue}", subscription.Source, subscription.Destination);
return context.CreateQueueSubscription(subscription.Source, subscription.Destination);
}
Task Declare(ClientContext context, Queue queue)
{
- LogContext.Debug?.Log("Create queue {Queue}", queue);
+ LogContext.LogDebug("Create queue {Queue}", queue);
return context.CreateQueue(queue);
}
Task Delete(ClientContext context, Topic topic)
{
- LogContext.Debug?.Log("Delete topic {Topic}", topic);
+ LogContext.LogDebug("Delete topic {Topic}", topic);
return context.DeleteTopic(topic);
}
Task Delete(ClientContext context, Queue queue)
{
- LogContext.Debug?.Log("Delete queue {Queue}", queue);
+ LogContext.LogDebug("Delete queue {Queue}", queue);
return context.DeleteQueue(queue);
}
Index: src/Persistence/MassTransit.DapperIntegration/DapperSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.DapperIntegration/DapperSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.DapperIntegration/DapperSagaConsumeContext.cs (date 1568023294905)
@@ -50,7 +50,7 @@
.QueryAsync($"DELETE FROM {_tableName} WHERE CorrelationId = @correlationId", new {correlationId})
.ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
}
Index: src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsBasicConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsBasicConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsBasicConsumer.cs (date 1568023406200)
@@ -82,7 +82,7 @@
try
{
if (!_pending.TryAdd(message.MessageId, context))
- LogContext.Error?.Log("Duplicate message: {MessageId}", message.MessageId);
+ LogContext.LogError("Duplicate message: {MessageId}", message.MessageId);
await _context.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
@@ -115,7 +115,7 @@
{
if (IsStopping)
{
- LogContext.Debug?.Log("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
_deliveryComplete.TrySetResult(true);
}
@@ -129,13 +129,13 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "DeliveryComplete faulted during shutdown: {InputAddress}", _context.InputAddress);
+ LogContext.LogError(exception, "DeliveryComplete faulted during shutdown: {InputAddress}", _context.InputAddress);
}
}
protected override async Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping consumer: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Stopping consumer: {InputAddress}", _context.InputAddress);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -154,7 +154,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
+ LogContext.LogWarning("Stop canceled waiting for message consumers to complete: {InputAddress}", _context.InputAddress);
}
}
}
Index: src/Persistence/MassTransit.DapperIntegration/DapperSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.DapperIntegration/DapperSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.DapperIntegration/DapperSagaRepository.cs (date 1568023406168)
@@ -91,7 +91,7 @@
}
else
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
await SendToInstance(context, connection, policy, instance, tableName, next).ConfigureAwait(false);
@@ -101,12 +101,12 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), correlationId, ex);
}
@@ -164,12 +164,12 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
}
@@ -189,7 +189,7 @@
}
catch (Exception ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
}
@@ -200,7 +200,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new DapperSagaConsumeContext<TSaga, T>(sqlConnection, context, instance, tableName);
@@ -262,7 +262,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
var sagaConsumeContext = new DapperSagaConsumeContext<TSaga, TMessage>(_sqlConnection, context, context.Saga, _tableName, false);
Index: src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsConsumerFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsConsumerFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AmazonSqsTransport/Pipeline/AmazonSqsConsumerFilter.cs (date 1568023295740)
@@ -66,7 +66,7 @@
await _context.TransportObservers.Completed(new ReceiveTransportCompletedEvent(inputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", inputAddress,
+ LogContext.LogDebug("Consumer completed {InputAddress}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", inputAddress,
metrics.DeliveryCount, metrics.ConcurrentDeliveryCount);
}
}
Index: src/MassTransit.Host/ServiceAssemblyScanner.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Host/ServiceAssemblyScanner.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Host/ServiceAssemblyScanner.cs (date 1568023394606)
@@ -97,7 +97,7 @@
}
catch (BadImageFormatException e)
{
- LogContext.Warning?.Log(e, "Assembly Scan failed: {File}", assemblyFile);
+ LogContext.LogWarning(e, "Assembly Scan failed: {File}", assemblyFile);
return null;
}
}
Index: src/MassTransit.QuartzIntegration/Configuration/SchedulerBusObserver.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.QuartzIntegration/Configuration/SchedulerBusObserver.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.QuartzIntegration/Configuration/SchedulerBusObserver.cs (date 1568023295698)
@@ -39,7 +39,7 @@
public async Task PostStart(IBus bus, Task<BusReady> busReady)
{
- LogContext.Debug?.Log("Quartz Scheduler Starting: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
+ LogContext.LogDebug("Quartz Scheduler Starting: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
_scheduler.SchedulerInstanceId);
await busReady.ConfigureAwait(false);
@@ -47,7 +47,7 @@
_scheduler.JobFactory = new MassTransitJobFactory(bus);
await _scheduler.Start().ConfigureAwait(false);
- LogContext.Debug?.Log("Quartz Scheduler Started: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
+ LogContext.LogDebug("Quartz Scheduler Started: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
_scheduler.SchedulerInstanceId);
}
@@ -60,7 +60,7 @@
{
await _scheduler.Standby().ConfigureAwait(false);
- LogContext.Debug?.Log("Quartz Scheduler Paused: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
+ LogContext.LogDebug("Quartz Scheduler Paused: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
_scheduler.SchedulerInstanceId);
}
@@ -68,7 +68,7 @@
{
await _scheduler.Shutdown().ConfigureAwait(false);
- LogContext.Debug?.Log("Quartz Scheduler Stopped: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
+ LogContext.LogDebug("Quartz Scheduler Stopped: {InputAddress} ({Name}/{InstanceId})", _schedulerEndpointAddress, _scheduler.SchedulerName,
_scheduler.SchedulerInstanceId);
}
Index: src/Persistence/MassTransit.MartenIntegration/MartenSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MartenIntegration/MartenSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MartenIntegration/MartenSagaRepository.cs (date 1568023406057)
@@ -105,13 +105,13 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
}
@@ -127,12 +127,12 @@
await session.SaveChangesAsync().ConfigureAwait(false);
inserted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
catch (Exception ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
@@ -146,7 +146,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
var sagaConsumeContext = new MartenSagaConsumeContext<TSaga, T>(session, context, instance);
@@ -158,14 +158,14 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(sex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(ex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), instance.CorrelationId, ex);
@@ -197,7 +197,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
SagaConsumeContext<TSaga, TMessage> proxy = new MartenSagaConsumeContext<TSaga, TMessage>(_session,
Index: src/MassTransit.Azure.ServiceBus.Core/Topology/TopologyLayoutExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Azure.ServiceBus.Core/Topology/TopologyLayoutExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Azure.ServiceBus.Core/Topology/TopologyLayoutExtensions.cs (date 1568023835457)
@@ -9,12 +9,12 @@
{
foreach (var topic in topology.Topics)
{
- LogContext.Info?.Log("Topic: {Topic}", topic.TopicDescription.Path);
+ LogContext.LogInformation("Topic: {Topic}", topic.TopicDescription.Path);
}
foreach (var subscription in topology.Subscriptions)
{
- LogContext.Info?.Log("Subscription: {Subscription}, topic: {Topic}", subscription.SubscriptionDescription.SubscriptionName,
+ LogContext.LogInformation("Subscription: {Subscription}, topic: {Topic}", subscription.SubscriptionDescription.SubscriptionName,
subscription.SubscriptionDescription.TopicPath);
}
}
Index: src/Persistence/MassTransit.MartenIntegration/MartenSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MartenIntegration/MartenSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MartenIntegration/MartenSagaConsumeContext.cs (date 1568023295371)
@@ -33,7 +33,7 @@
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
Index: src/MassTransit.Host/AssemblyBusServiceConfigurator.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Host/AssemblyBusServiceConfigurator.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Host/AssemblyBusServiceConfigurator.cs (date 1568023835511)
@@ -44,7 +44,7 @@
void IBusServiceConfigurator.Configure(IServiceConfigurator configurator)
{
- LogContext.Info?.Log("Configuring Service: {ServiceName}", TypeMetadataCache.GetShortName(_serviceSpecification.GetType()));
+ LogContext.LogInformation("Configuring Service: {ServiceName}", TypeMetadataCache.GetShortName(_serviceSpecification.GetType()));
_serviceSpecification.Configure(configurator);
@@ -54,14 +54,14 @@
int consumerLimit;
GetEndpointSettings(specification, out queueName, out consumerLimit);
- LogContext.Info?.Log("Configuring Endpoint: {EndpointName} (queue-name: {Queue}, consumer-limit: {ConsumerLimit})",
+ LogContext.LogInformation("Configuring Endpoint: {EndpointName} (queue-name: {Queue}, consumer-limit: {ConsumerLimit})",
TypeMetadataCache.GetShortName(_serviceSpecification.GetType()), queueName, consumerLimit);
configurator.ReceiveEndpoint(queueName, consumerLimit, x =>
{
specification.Configure(x);
- LogContext.Info?.Log("Configured Endpoint: {EndpointName} (address: {InputAddress})",
+ LogContext.LogInformation("Configured Endpoint: {EndpointName} (address: {InputAddress})",
TypeMetadataCache.GetShortName(_serviceSpecification.GetType()), x.InputAddress);
});
}
Index: src/MassTransit/IActivityScope.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/IActivityScope.cs (date 1568025290829)
+++ src/MassTransit/IActivityScope.cs (date 1568025290829)
@@ -0,0 +1,47 @@
+namespace MassTransit
+{
+ using System;
+ using System.Diagnostics;
+
+
+ public interface IActivityScope : IDisposable
+ {
+ Activity Current { get; }
+ }
+
+
+ class ActivityScope : IActivityScope
+ {
+ readonly DiagnosticSource _source;
+ readonly string _name;
+
+ public ActivityScope(DiagnosticSource source, string name, object args = default)
+ {
+ _source = source;
+ _name = name;
+ Current = new Activity(_name);
+ Start(args);
+ }
+
+ void Stop(object args = default)
+ {
+ if (IsEnabled(_name))
+ _source?.StopActivity(Current, args ?? new { });
+ }
+
+ void Start(object args = default)
+ {
+ if (IsEnabled(_name))
+ _source?.StartActivity(Current, args ?? new { });
+ }
+
+ public void Dispose()
+ {
+ Stop();
+ }
+
+ public Activity Current { get; }
+
+ bool IsEnabled(string name) => _source.IsEnabled(name);
+ }
+}
Index: src/MassTransit/DiagnosticSourceExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/DiagnosticSourceExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/DiagnosticSourceExtensions.cs (date 1568025194820)
@@ -8,23 +8,9 @@
public static class DiagnosticSourceExtensions
{
- public static EnabledDiagnosticSource? IfEnabled(this DiagnosticSource source, string name)
- {
- return source.IsEnabled(name) ? new EnabledDiagnosticSource(source, name) : default(EnabledDiagnosticSource?);
- }
-
- public static void IfEnabled(this DiagnosticSource source, Activity activity, object args = null)
+ public static void AddSendContextHeaders(this IActivityScope activityScope, SendContext context)
{
- if (activity != null)
- source.StopActivity(activity, args);
- }
-
- public static StartedActivity? AddSendContextHeaders(this StartedActivity? startedActivity, SendContext context)
- {
- if (!startedActivity.HasValue)
- return startedActivity;
-
- var activity = startedActivity.Value.Activity;
+ var activity = activityScope.Current;
context.Headers.Set(DiagnosticHeaders.ActivityId, activity.Id);
@@ -44,16 +30,11 @@
activity.AddBaggage(DiagnosticHeaders.CorrelationId, context.CorrelationId.Value.ToString());
if (context.ConversationId.HasValue)
activity.AddBaggage(DiagnosticHeaders.CorrelationConversationId, context.ConversationId.Value.ToString());
-
- return startedActivity;
}
- public static StartedActivity? AddReceiveContextHeaders(this StartedActivity? startedActivity, ReceiveContext context)
+ public static void AddReceiveContextHeaders(this IActivityScope activityScope, ReceiveContext context)
{
- if (!startedActivity.HasValue)
- return startedActivity;
-
- var activity = startedActivity.Value.Activity;
+ var activity = activityScope.Current;
activity.AddTag(DiagnosticHeaders.InputAddress, context.InputAddress.ToString());
@@ -61,11 +42,9 @@
activity.AddTag(DiagnosticHeaders.MessageId, messageIdHeader.ToString());
context.AddOrUpdatePayload(() => activity, _ => activity);
-
- return startedActivity;
}
- public static Activity AddConsumeContextHeaders(this Activity activity, ConsumeContext context)
+ public static void AddConsumeContextHeaders(this Activity activity, ConsumeContext context)
{
if (context.MessageId.HasValue)
activity.AddTag(DiagnosticHeaders.MessageId, context.MessageId.Value.ToString());
@@ -106,8 +85,6 @@
activity.AddBaggage(value.Key, value.Value);
}
}
-
- return activity;
}
}
}
Index: src/Persistence/MassTransit.MongoDbIntegration/Saga/MongoDbSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MongoDbIntegration/Saga/MongoDbSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MongoDbIntegration/Saga/MongoDbSagaRepository.cs (date 1568023406035)
@@ -111,13 +111,13 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(sex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw;
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
+ LogContext.LogError(ex, "SAGA:{SagaType} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName, TypeMetadataCache<T>.ShortName);
throw new SagaException(ex.Message, typeof(TSaga), typeof(T), Guid.Empty, ex);
}
@@ -130,12 +130,12 @@
{
await _collection.InsertOneAsync(instance, cancellationToken: context.CancellationToken).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Insert {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
catch (Exception ex)
{
- LogContext.Debug?.Log(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug(ex, "SAGA:{SagaType}:{CorrelationId} Dupe {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
}
}
@@ -145,7 +145,7 @@
{
try
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance.CorrelationId, TypeMetadataCache<T>.ShortName);
SagaConsumeContext<TSaga, T> sagaConsumeContext = _mongoDbSagaConsumeContextFactory.Create(_collection, context, instance);
@@ -157,7 +157,7 @@
}
catch (SagaException sex)
{
- LogContext.Error?.Log(sex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogError(sex, "SAGA:{SagaType}:{CorrelationId} Exception {MessageType}", TypeMetadataCache<TSaga>.ShortName,
instance?.CorrelationId, TypeMetadataCache<T>.ShortName);
throw;
Index: src/Persistence/MassTransit.MongoDbIntegration/Saga/Pipeline/MissingPipe.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MongoDbIntegration/Saga/Pipeline/MissingPipe.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MongoDbIntegration/Saga/Pipeline/MissingPipe.cs (date 1568023294841)
@@ -32,7 +32,7 @@
public async Task Send(SagaConsumeContext<TSaga, TMessage> context)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Added {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
SagaConsumeContext<TSaga, TMessage> proxy = _mongoDbSagaConsumeContextFactory.Create(_collection, context, context.Saga, false);
Index: src/MassTransit.Futures/Steward/Core/Agents/MessageDispatchAgent.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Futures/Steward/Core/Agents/MessageDispatchAgent.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Futures/Steward/Core/Agents/MessageDispatchAgent.cs (date 1568023406026)
@@ -44,7 +44,7 @@
"An exception occurred sending message {0} to {1}", string.Join(",", context.DispatchTypes),
context.Destination);
- LogContext.Error?.Log(ex, message);
+ LogContext.LogError(ex, message);
throw new DispatchException(message, ex);
}
Index: src/Persistence/MassTransit.MongoDbIntegration/Saga/Context/MongoDbSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Persistence/MassTransit.MongoDbIntegration/Saga/Context/MongoDbSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/Persistence/MassTransit.MongoDbIntegration/Saga/Context/MongoDbSagaConsumeContext.cs (date 1568023295193)
@@ -38,7 +38,7 @@
if (result.DeletedCount == 0)
throw new MongoDbConcurrencyException("Unable to delete saga. It may not have been found or may have been updated by another process.");
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName,
Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
}
}
Index: src/MassTransit/Configuration/BatchConsumerExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/BatchConsumerExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/BatchConsumerExtensions.cs (date 1568023295298)
@@ -21,7 +21,7 @@
public static void Batch<TMessage>(this IReceiveEndpointConfigurator configurator, Action<IBatchConfigurator<TMessage>> configure)
where TMessage : class
{
- LogContext.Debug?.Log("Configuring batch: {MessageType}", TypeMetadataCache<TMessage>.ShortName);
+ LogContext.LogDebug("Configuring batch: {MessageType}", TypeMetadataCache<TMessage>.ShortName);
var batchConfigurator = new BatchConfigurator<TMessage>(configurator);
@@ -40,7 +40,7 @@
where TConsumer : class, IConsumer<Batch<TMessage>>
where TMessage : class
{
- LogContext.Debug?.Log("Subscribing Batch Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Subscribing Batch Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
var delegateConsumerFactory = new DelegateConsumerFactory<TConsumer>(consumerFactoryMethod);
@@ -59,7 +59,7 @@
where TConsumer : class, IConsumer<Batch<TMessage>>
where TMessage : class
{
- LogContext.Debug?.Log("Subscribing Batch Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Subscribing Batch Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
configurator.Consumer(consumerFactory);
}
Index: src/MassTransit/Transports/ReceiveEndpointLoggingExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Transports/ReceiveEndpointLoggingExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Transports/ReceiveEndpointLoggingExtensions.cs (date 1568023763017)
@@ -13,7 +13,7 @@
/// <param name="context"></param>
public static void LogSkipped(this ReceiveContext context)
{
- LogContext.Current?.Messages.Debug?.Log("SKIP {InputAddress} {MessageId}", context.InputAddress, GetMessageId(context));
+ LogContext.Current?.Messages.LogDebug("SKIP {InputAddress} {MessageId}", context.InputAddress, GetMessageId(context));
}
/// <summary>
@@ -24,61 +24,61 @@
/// <param name="reason"> </param>
public static void LogMoved(this ReceiveContext context, string destination, string reason)
{
- LogContext.Current?.Messages.Info?.Log("MOVE {InputAddress} {MessageId} {DestinationAddress} {Reason}", context.InputAddress,
+ LogContext.Current?.Messages.LogInformation("MOVE {InputAddress} {MessageId} {DestinationAddress} {Reason}", context.InputAddress,
GetMessageId(context), destination, reason);
}
public static void LogConsumed<T>(this ConsumeContext<T> context, TimeSpan duration, string consumerType)
where T : class
{
- LogContext.Current?.Messages.Debug?.Log("RECEIVE {InputAddress} {MessageId} {MessageType} {ConsumerType}({Duration})",
+ LogContext.Current?.Messages.LogDebug("RECEIVE {InputAddress} {MessageId} {MessageType} {ConsumerType}({Duration})",
context.ReceiveContext.InputAddress, context.MessageId, TypeMetadataCache<T>.ShortName, consumerType, duration);
}
public static void LogFaulted<T>(this ConsumeContext<T> context, TimeSpan duration, string consumerType, Exception exception)
where T : class
{
- LogContext.Current?.Messages.Error?.Log("R-FAULT {InputAddress} {MessageId} {MessageType} {ConsumerType}({Duration}) {Exception}",
+ LogContext.Current?.Messages.LogError("R-FAULT {InputAddress} {MessageId} {MessageType} {ConsumerType}({Duration}) {Exception}",
context.ReceiveContext.InputAddress, context.MessageId, TypeMetadataCache<T>.ShortName, consumerType, duration, GetFaultMessage(exception));
}
public static void LogFaulted(this ReceiveContext context, Exception exception)
{
- LogContext.Current?.Messages.Error?.Log("R-FAULT {InputAddress} {MessageId} {Exception}", context.InputAddress, GetMessageId(context),
+ LogContext.Current?.Messages.LogError("R-FAULT {InputAddress} {MessageId} {Exception}", context.InputAddress, GetMessageId(context),
GetFaultMessage(exception));
}
public static void LogRetry(this ConsumeContext context, Exception exception)
{
- LogContext.Current?.Messages.Warning?.Log("R-RETRY {InputAddress} {MessageId} {Exception}", context.ReceiveContext.InputAddress,
+ LogContext.Current?.Messages.LogWarning("R-RETRY {InputAddress} {MessageId} {Exception}", context.ReceiveContext.InputAddress,
context.MessageId, GetFaultMessage(exception));
}
public static void LogRetry<T>(this ConsumeContext<T> context, Exception exception)
where T : class
{
- LogContext.Current?.Messages.Warning?.Log("R-RETRY {InputAddress} {MessageId} {MessageType} {Exception}", context.ReceiveContext.InputAddress,
+ LogContext.Current?.Messages.LogWarning("R-RETRY {InputAddress} {MessageId} {MessageType} {Exception}", context.ReceiveContext.InputAddress,
context.MessageId, TypeMetadataCache<T>.ShortName, GetFaultMessage(exception));
}
public static void LogFaulted<T>(this SendContext<T> context, Exception exception)
where T : class
{
- LogContext.Current?.Messages.Error?.Log("S-FAULT {DestinationAddress} {MessageId} {MessageType} {Exception}", context.DestinationAddress,
+ LogContext.Current?.Messages.LogError("S-FAULT {DestinationAddress} {MessageId} {MessageType} {Exception}", context.DestinationAddress,
context.MessageId, TypeMetadataCache<T>.ShortName, GetFaultMessage(exception));
}
public static void LogSent<T>(this SendContext<T> context)
where T : class
{
- LogContext.Current?.Messages.Debug?.Log("SEND {DestinationAddress} {MessageId} {MessageType}", context.DestinationAddress, context.MessageId,
+ LogContext.Current?.Messages.LogDebug("SEND {DestinationAddress} {MessageId} {MessageType}", context.DestinationAddress, context.MessageId,
TypeMetadataCache<T>.ShortName);
}
public static void LogScheduled<T>(this SendContext<T> context, DateTime deliveryTime)
where T : class
{
- LogContext.Current?.Messages.Debug?.Log("SCHED {DestinationAddress} {MessageId} {MessageType} {DeliveryTime:G} {Token}", context.DestinationAddress,
+ LogContext.Current?.Messages.LogDebug("SCHED {DestinationAddress} {MessageId} {MessageType} {DeliveryTime:G} {Token}", context.DestinationAddress,
context.MessageId, TypeMetadataCache<T>.ShortName, deliveryTime, context.ScheduledMessageId?.ToString("D"));
}
Index: src/MassTransit.RabbitMqTransport/Hosting/RabbitMqHostBusFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Hosting/RabbitMqHostBusFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Hosting/RabbitMqHostBusFactory.cs (date 1568023835449)
@@ -33,7 +33,7 @@
{
var host = configurator.Host(_hostSettings);
- LogContext.Info?.Log("Configuring Host: {Host}", _hostSettings.ToDescription());
+ LogContext.LogInformation("Configuring Host: {Host}", _hostSettings.ToDescription());
var serviceConfigurator = new RabbitMqServiceConfigurator(configurator, host);
Index: src/MassTransit.Tests/InMemoryDuo_Specs.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.Tests/InMemoryDuo_Specs.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.Tests/InMemoryDuo_Specs.cs (date 1568023835462)
@@ -74,7 +74,7 @@
if (GetVirtualHost(context.SourceAddress) != GetVirtualHost(context.ReceiveContext.InputAddress))
return TaskUtil.Completed;
- LogContext.Info?.Log("Forwarding message: {MessageId} from {SourceAddress}", context.MessageId, context.SourceAddress);
+ LogContext.LogInformation("Forwarding message: {MessageId} from {SourceAddress}", context.MessageId, context.SourceAddress);
IPipe<SendContext> contextPipe = context.CreateCopyContextPipe();
Index: src/MassTransit/Automatonymous/MassTransitStateMachine.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Automatonymous/MassTransitStateMachine.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Automatonymous/MassTransitStateMachine.cs (date 1568023295474)
@@ -311,7 +311,7 @@
{
if (!tokenId.HasValue || (messageTokenId.Value != tokenId.Value))
{
- LogContext.Debug?.Log("SAGA: {CorrelationId} Scheduled message not current: {TokenId}", context.Instance.CorrelationId,
+ LogContext.LogDebug("SAGA: {CorrelationId} Scheduled message not current: {TokenId}", context.Instance.CorrelationId,
messageTokenId.Value);
return;
Index: src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaConsumeContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaConsumeContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaConsumeContext.cs (date 1568023295544)
@@ -44,7 +44,7 @@
IsCompleted = true;
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed {MessageType}", TypeMetadataCache<TSaga>.ShortName, Saga.CorrelationId,
TypeMetadataCache<TMessage>.ShortName);
}
Index: src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaRepository.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaRepository.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Saga/MessageSessionSagaRepository.cs (date 1568023295094)
@@ -59,7 +59,7 @@
{
SagaConsumeContext<TSaga, T> sagaConsumeContext = new MessageSessionSagaConsumeContext<TSaga, T>(context, sessionContext, saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Used {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.CorrelationId, TypeMetadataCache<T>.ShortName);
await policy.Existing(sagaConsumeContext, next).ConfigureAwait(false);
@@ -68,7 +68,7 @@
{
await WriteSagaState(sessionContext, saga).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Updated {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Updated {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.CorrelationId, TypeMetadataCache<T>.ShortName);
}
}
@@ -156,7 +156,7 @@
var proxy = new MessageSessionSagaConsumeContext<TSaga, TMessage>(context, sessionContext, context.Saga);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Created {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
try
@@ -167,13 +167,13 @@
{
await _writeSagaState(sessionContext, proxy.Saga).ConfigureAwait(false);
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Saved {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Saved {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
}
}
catch (Exception)
{
- LogContext.Debug?.Log("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
+ LogContext.LogDebug("SAGA:{SagaType}:{CorrelationId} Removed(Fault) {MessageType}", TypeMetadataCache<TSaga>.ShortName,
context.Saga.CorrelationId, TypeMetadataCache<TMessage>.ShortName);
throw;
Index: src/MassTransit.AzureServiceBusTransport/Hosting/ServiceBusHostBusFactory.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Hosting/ServiceBusHostBusFactory.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Hosting/ServiceBusHostBusFactory.cs (date 1568023835480)
@@ -76,7 +76,7 @@
}
});
- LogContext.Info?.Log("Configuring Host: {Host}", hostSettings.ServiceUri);
+ LogContext.LogInformation("Configuring Host: {Host}", hostSettings.ServiceUri);
var serviceConfigurator = new ServiceBusServiceConfigurator(configurator, host);
Index: src/MassTransit/Courier/Hosts/ExecuteActivityHost.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Courier/Hosts/ExecuteActivityHost.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Courier/Hosts/ExecuteActivityHost.cs (date 1568023405935)
@@ -40,50 +40,47 @@
public async Task Send(ConsumeContext<RoutingSlip> context, IPipe<ConsumeContext<RoutingSlip>> next)
{
- var activity = LogContext.IfEnabled(OperationName.Courier.Compensate)?.StartActivity(new
+ using (var activity = LogContext.StartActivity(OperationName.Courier.Compensate, new
{
ActivityType = TypeMetadataCache<TActivity>.ShortName,
ArgumentType = TypeMetadataCache<TArguments>.ShortName
- });
-
- var timer = Stopwatch.StartNew();
- try
- {
- await Task.Yield();
+ }))
+ {
+ var timer = Stopwatch.StartNew();
+ try
+ {
+ await Task.Yield();
- ExecuteContext<TArguments> executeContext = new HostExecuteContext<TArguments>(HostMetadataCache.Host, _compensateAddress, context);
+ ExecuteContext<TArguments> executeContext = new HostExecuteContext<TArguments>(HostMetadataCache.Host, _compensateAddress, context);
- LogContext.Debug?.Log("Execute Activity: {TrackingNumber} ({Activity}, {Host})", executeContext.TrackingNumber,
- TypeMetadataCache<TActivity>.ShortName, context.ReceiveContext.InputAddress);
+ LogContext.LogDebug("Execute Activity: {TrackingNumber} ({Activity}, {Host})", executeContext.TrackingNumber,
+ TypeMetadataCache<TActivity>.ShortName, context.ReceiveContext.InputAddress);
- try
- {
- var result = await _activityFactory.Execute(executeContext, _executePipe).Result().ConfigureAwait(false);
+ try
+ {
+ var result = await _activityFactory.Execute(executeContext, _executePipe).Result().ConfigureAwait(false);
- await result.Evaluate().ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- var result = executeContext.Faulted(ex);
+ await result.Evaluate().ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ var result = executeContext.Faulted(ex);
- await result.Evaluate().ConfigureAwait(false);
- }
+ await result.Evaluate().ConfigureAwait(false);
+ }
- await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName).ConfigureAwait(false);
+ await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName).ConfigureAwait(false);
- await next.Send(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName, ex).ConfigureAwait(false);
+ await next.Send(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName, ex).ConfigureAwait(false);
- LogContext.Error?.Log(ex, "Activity {Activity} execution faulted: {Exception}", TypeMetadataCache<TActivity>.ShortName);
+ LogContext.LogError(ex, "Activity {Activity} execution faulted: {Exception}", TypeMetadataCache<TActivity>.ShortName);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
Index: src/MassTransit.RabbitMqTransport/Contexts/RabbitMqConnectionContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Contexts/RabbitMqConnectionContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Contexts/RabbitMqConnectionContext.cs (date 1568023295110)
@@ -67,11 +67,11 @@
{
_connection.ConnectionShutdown -= OnConnectionShutdown;
- LogContext.Debug?.Log("Disconnecting: {Host}", Description);
+ LogContext.LogDebug("Disconnecting: {Host}", Description);
_connection.Cleanup(200, "Connection Disposed");
- LogContext.Debug?.Log("Disconnected: {Host}", Description);
+ LogContext.LogDebug("Disconnected: {Host}", Description);
return TaskUtil.Completed;
}
Index: src/MassTransit/Courier/Hosts/CompensateActivityHost.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Courier/Hosts/CompensateActivityHost.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Courier/Hosts/CompensateActivityHost.cs (date 1568023405922)
@@ -27,50 +27,47 @@
public async Task Send(ConsumeContext<RoutingSlip> context, IPipe<ConsumeContext<RoutingSlip>> next)
{
- var activity = LogContext.IfEnabled(OperationName.Courier.Compensate)?.StartActivity(new
+ using (var activity = LogContext.StartActivity(OperationName.Courier.Compensate, new
{
ActivityType = TypeMetadataCache<TActivity>.ShortName,
LogType = TypeMetadataCache<TLog>.ShortName
- });
-
- var timer = Stopwatch.StartNew();
- try
- {
- await Task.Yield();
+ }))
+ {
+ var timer = Stopwatch.StartNew();
+ try
+ {
+ await Task.Yield();
- CompensateContext<TLog> compensateContext = new HostCompensateContext<TLog>(HostMetadataCache.Host, context);
+ CompensateContext<TLog> compensateContext = new HostCompensateContext<TLog>(HostMetadataCache.Host, context);
- LogContext.Debug?.Log("Compensate Activity: {TrackingNumber} ({Activity}, {Host})", compensateContext.TrackingNumber,
- TypeMetadataCache<TActivity>.ShortName, context.ReceiveContext.InputAddress);
+ LogContext.LogDebug("Compensate Activity: {TrackingNumber} ({Activity}, {Host})", compensateContext.TrackingNumber,
+ TypeMetadataCache<TActivity>.ShortName, context.ReceiveContext.InputAddress);
- try
- {
- var result = await _activityFactory.Compensate(compensateContext, _compensatePipe).Result().ConfigureAwait(false);
+ try
+ {
+ var result = await _activityFactory.Compensate(compensateContext, _compensatePipe).Result().ConfigureAwait(false);
- await result.Evaluate().ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- var result = compensateContext.Failed(ex);
+ await result.Evaluate().ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ var result = compensateContext.Failed(ex);
- await result.Evaluate().ConfigureAwait(false);
- }
+ await result.Evaluate().ConfigureAwait(false);
+ }
- await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName).ConfigureAwait(false);
+ await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName).ConfigureAwait(false);
- await next.Send(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName, ex).ConfigureAwait(false);
+ await next.Send(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TActivity>.ShortName, ex).ConfigureAwait(false);
- LogContext.Error?.Log(ex, "Activity {Activity} compensation faulted", TypeMetadataCache<TActivity>.ShortName);
+ LogContext.LogError(ex, "Activity {Activity} compensation faulted", TypeMetadataCache<TActivity>.ShortName);
- throw;
- }
- finally
- {
- activity?.Stop();
+ throw;
+ }
}
}
Index: src/MassTransit/Pipeline/Filters/HandlerMessageFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Pipeline/Filters/HandlerMessageFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Pipeline/Filters/HandlerMessageFilter.cs (date 1568023461798)
@@ -53,31 +53,28 @@
[DebuggerNonUserCode]
async Task IFilter<ConsumeContext<TMessage>>.Send(ConsumeContext<TMessage> context, IPipe<ConsumeContext<TMessage>> next)
{
- var activity = LogContext.IfEnabled(OperationName.Consumer.Handle)?.StartActivity(new {MessageType = TypeMetadataCache<TMessage>.ShortName});
-
- Stopwatch timer = Stopwatch.StartNew();
- try
- {
- await Task.Yield();
+ using (var activity = LogContext.StartActivity(OperationName.Consumer.Handle, new {MessageType = TypeMetadataCache<TMessage>.ShortName}))
+ {
+ Stopwatch timer = Stopwatch.StartNew();
+ try
+ {
+ await Task.Yield();
- await _handler(context).ConfigureAwait(false);
+ await _handler(context).ConfigureAwait(false);
- await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<MessageHandler<TMessage>>.ShortName).ConfigureAwait(false);
+ await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<MessageHandler<TMessage>>.ShortName).ConfigureAwait(false);
- Interlocked.Increment(ref _completed);
+ Interlocked.Increment(ref _completed);
- await next.Send(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<MessageHandler<TMessage>>.ShortName, ex).ConfigureAwait(false);
+ await next.Send(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<MessageHandler<TMessage>>.ShortName, ex).ConfigureAwait(false);
- Interlocked.Increment(ref _faulted);
- throw;
- }
- finally
- {
- activity?.Stop();
+ Interlocked.Increment(ref _faulted);
+ throw;
+ }
}
}
}
Index: src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusMessagingFactoryContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusMessagingFactoryContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusMessagingFactoryContext.cs (date 1568023295397)
@@ -38,7 +38,7 @@
{
await _messagingFactory.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed messaging factory: {Host}", _messagingFactory.Address);
+ LogContext.LogDebug("Closed messaging factory: {Host}", _messagingFactory.Address);
}
MessagingFactory MessagingFactoryContext.MessagingFactory => _messagingFactory;
Index: src/MassTransit.RabbitMqTransport/Contexts/RabbitMqModelContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Contexts/RabbitMqModelContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Contexts/RabbitMqModelContext.cs (date 1568023406017)
@@ -47,7 +47,7 @@
public Task DisposeAsync(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Closing model: {ChannelNumber} {Host}", _model.ChannelNumber, _connectionContext.Description);
+ LogContext.LogDebug("Closing model: {ChannelNumber} {Host}", _model.ChannelNumber, _connectionContext.Description);
try
{
@@ -61,10 +61,10 @@
_model.WaitForConfirms(_connectionContext.StopTimeout, out timedOut);
if (timedOut)
- LogContext.Warning?.Log("Timeout waiting for pending confirms: {ChannelNumber} {Host}", _model.ChannelNumber,
+ LogContext.LogWarning("Timeout waiting for pending confirms: {ChannelNumber} {Host}", _model.ChannelNumber,
_connectionContext.Description);
else
- LogContext.Debug?.Log("Pending confirms complete: {ChannelNumber} {Host}", _model.ChannelNumber,
+ LogContext.LogDebug("Pending confirms complete: {ChannelNumber} {Host}", _model.ChannelNumber,
_connectionContext.Description);
}
while (timedOut);
@@ -72,7 +72,7 @@
}
catch (Exception ex)
{
- LogContext.Error?.Log(ex, "Fault waiting for pending confirms: {ChannelNumber} {Host}", _model.ChannelNumber,
+ LogContext.LogError(ex, "Fault waiting for pending confirms: {ChannelNumber} {Host}", _model.ChannelNumber,
_connectionContext.Description);
}
@@ -178,7 +178,7 @@
void OnBasicReturn(object model, BasicReturnEventArgs args)
{
- LogContext.Debug?.Log("BasicReturn: {ReplyCode}-{ReplyText} {MessageId}", args.ReplyCode, args.ReplyText, args.BasicProperties.MessageId);
+ LogContext.LogDebug("BasicReturn: {ReplyCode}-{ReplyText} {MessageId}", args.ReplyCode, args.ReplyText, args.BasicProperties.MessageId);
if (args.BasicProperties.Headers.TryGetValue("publishId", out var value))
{
Index: src/MassTransit.RabbitMqTransport/Pipeline/PurgeOnStartupFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Pipeline/PurgeOnStartupFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Pipeline/PurgeOnStartupFilter.cs (date 1568023295456)
@@ -41,13 +41,13 @@
{
var purgedMessageCount = await context.QueuePurge(queueName).ConfigureAwait(false);
- LogContext.Debug?.Log("Purged {MessageCount} messages from queue {QueueName}", purgedMessageCount, queueName);
+ LogContext.LogDebug("Purged {MessageCount} messages from queue {QueueName}", purgedMessageCount, queueName);
_queueAlreadyPurged = true;
}
else
{
- LogContext.Debug?.Log("Queue {QueueName} was purged at startup, skipping", queueName);
+ LogContext.LogDebug("Queue {QueueName} was purged at startup, skipping", queueName);
}
}
}
Index: src/MassTransit.AzureServiceBusTransport/Contexts/QueueClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Contexts/QueueClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Contexts/QueueClientContext.cs (date 1568023394891)
@@ -56,11 +56,11 @@
if (_client != null && !_client.IsClosed)
await _client.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closed client: {InputAddress}", InputAddress);
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Close client faulted: {InputAddress}", InputAddress);
+ LogContext.LogWarning(exception, "Close client faulted: {InputAddress}", InputAddress);
}
}
}
Index: src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqBasicConsumer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqBasicConsumer.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqBasicConsumer.cs (date 1568024024087)
@@ -64,7 +64,7 @@
{
LogContext.Current = _context.LogContext;
- LogContext.Debug?.Log("Consumer Ok: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
+ LogContext.LogDebug("Consumer Ok: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
_consumerTag = consumerTag;
@@ -80,7 +80,7 @@
{
LogContext.Current = _context.LogContext;
- LogContext.Debug?.Log("Consumer Cancel Ok: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
+ LogContext.LogDebug("Consumer Cancel Ok: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
_deliveryComplete.TrySetResult(true);
SetCompleted(TaskUtil.Completed);
@@ -95,7 +95,7 @@
{
LogContext.Current = _context.LogContext;
- LogContext.Debug?.Log("Consumer Canceled: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
+ LogContext.LogDebug("Consumer Canceled: {InputAddress} - {ConsumerTag}", _context.InputAddress, consumerTag);
foreach (var context in _pending.Values)
context.Cancel();
@@ -110,7 +110,7 @@
{
LogContext.Current = _context.LogContext;
- LogContext.Debug?.Log(
+ LogContext.LogDebug(
"Consumer Model Shutdown: {InputAddress} - {ConsumerTag}, Concurrent Peak: {MaxConcurrentDeliveryCount}, {ReplyCode}-{ReplyText}",
_context.InputAddress, _consumerTag, _tracker.MaxConcurrentDeliveryCount, reason.ReplyCode, reason.ReplyText);
@@ -138,45 +138,45 @@
context.GetOrAddPayload(() => _model);
context.GetOrAddPayload(() => _model.ConnectionContext);
- var activity = LogContext.IfEnabled(OperationName.Transport.Receive)?.StartActivity();
- activity.AddReceiveContextHeaders(context);
+ using (var activity = LogContext.StartActivity(OperationName.Transport.Receive))
+ {
+ activity.AddReceiveContextHeaders(context);
- try
- {
- if (!_pending.TryAdd(deliveryTag, context))
- LogContext.Warning?.Log("Duplicate BasicDeliver: {DeliveryTag}", deliveryTag);
+ try
+ {
+ if (!_pending.TryAdd(deliveryTag, context))
+ LogContext.LogWarning("Duplicate BasicDeliver: {DeliveryTag}", deliveryTag);
- await _context.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
+ await _context.ReceiveObservers.PreReceive(context).ConfigureAwait(false);
- await _context.ReceivePipe.Send(context).ConfigureAwait(false);
+ await _context.ReceivePipe.Send(context).ConfigureAwait(false);
- await context.ReceiveCompleted.ConfigureAwait(false);
+ await context.ReceiveCompleted.ConfigureAwait(false);
- _model.BasicAck(deliveryTag, false);
+ _model.BasicAck(deliveryTag, false);
- await _context.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await _context.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
+ await _context.ReceiveObservers.PostReceive(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await _context.ReceiveObservers.ReceiveFault(context, ex).ConfigureAwait(false);
- try
- {
- _model.BasicNack(deliveryTag, false, true);
- }
- catch (Exception ackEx)
- {
- LogContext.Error?.Log(ackEx, "Message NACK failed: {DeliveryTag}", deliveryTag);
- }
- }
- finally
- {
- activity?.Stop();
-
- delivery.Dispose();
+ try
+ {
+ _model.BasicNack(deliveryTag, false, true);
+ }
+ catch (Exception ackEx)
+ {
+ LogContext.LogError(ackEx, "Message NACK failed: {DeliveryTag}", deliveryTag);
+ }
+ }
+ finally
+ {
+ delivery.Dispose();
- _pending.TryRemove(deliveryTag, out _);
- context.Dispose();
+ _pending.TryRemove(deliveryTag, out _);
+ context.Dispose();
+ }
}
}
@@ -194,7 +194,7 @@
{
if (IsStopping)
{
- LogContext.Debug?.Log("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
+ LogContext.LogDebug("Consumer shutdown completed: {InputAddress}", _context.InputAddress);
_deliveryComplete.TrySetResult(true);
}
@@ -210,14 +210,14 @@
}
catch (Exception exception)
{
- LogContext.Error?.Log(exception, "Message NACK faulted during shutdown: {InputAddress} - {ConsumerTag}", _context.InputAddress,
+ LogContext.LogError(exception, "Message NACK faulted during shutdown: {InputAddress} - {ConsumerTag}", _context.InputAddress,
_consumerTag);
}
}
protected override async Task StopSupervisor(StopSupervisorContext context)
{
- LogContext.Debug?.Log("Stopping Consumer: {InputAddress} - {ConsumerTag}", _context.InputAddress, _consumerTag);
+ LogContext.LogDebug("Stopping Consumer: {InputAddress} - {ConsumerTag}", _context.InputAddress, _consumerTag);
SetCompleted(ActiveAndActualAgentsCompleted(context));
@@ -248,7 +248,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for message consumers to complete: {InputAddress} - {ConsumerTag}",
+ LogContext.LogWarning("Stop canceled waiting for message consumers to complete: {InputAddress} - {ConsumerTag}",
_context.InputAddress, _consumerTag);
}
}
@@ -259,7 +259,7 @@
}
catch (OperationCanceledException)
{
- LogContext.Warning?.Log("Stop canceled waiting for consumer cancellation: {InputAddress} - {ConsumerTag}", _context.InputAddress,
+ LogContext.LogWarning("Stop canceled waiting for consumer cancellation: {InputAddress} - {ConsumerTag}", _context.InputAddress,
_consumerTag);
}
}
Index: src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqConsumerFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqConsumerFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Pipeline/RabbitMqConsumerFilter.cs (date 1568023295208)
@@ -65,7 +65,7 @@
RabbitMqDeliveryMetrics metrics = consumer;
await _receiveEndpointContext.TransportObservers.Completed(new ReceiveTransportCompletedEvent(inputAddress, metrics)).ConfigureAwait(false);
- LogContext.Debug?.Log("Consumer completed {ConsumerTag}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", metrics.ConsumerTag,
+ LogContext.LogDebug("Consumer completed {ConsumerTag}: {DeliveryCount} received, {ConcurrentDeliveryCount} concurrent", metrics.ConsumerTag,
metrics.DeliveryCount, metrics.ConcurrentDeliveryCount);
}
}
Index: src/MassTransit/Pipeline/Filters/ConsumerMessageFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Pipeline/Filters/ConsumerMessageFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Pipeline/Filters/ConsumerMessageFilter.cs (date 1568023445482)
@@ -54,31 +54,28 @@
[DebuggerNonUserCode]
async Task IFilter<ConsumeContext<TMessage>>.Send(ConsumeContext<TMessage> context, IPipe<ConsumeContext<TMessage>> next)
{
- var activity = LogContext.IfEnabled(OperationName.Consumer.Consume)?.StartActivity(new
+ using (var activity = LogContext.StartActivity(OperationName.Consumer.Consume, new
{
ConsumerType = TypeMetadataCache<TConsumer>.ShortName,
MessageType = TypeMetadataCache<TMessage>.ShortName
- });
-
- var timer = Stopwatch.StartNew();
- try
- {
- await Task.Yield();
+ }))
+ {
+ var timer = Stopwatch.StartNew();
+ try
+ {
+ await Task.Yield();
- await _consumerFactory.Send(context, _consumerPipe).ConfigureAwait(false);
+ await _consumerFactory.Send(context, _consumerPipe).ConfigureAwait(false);
- await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TConsumer>.ShortName).ConfigureAwait(false);
+ await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache<TConsumer>.ShortName).ConfigureAwait(false);
- await next.Send(context).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TConsumer>.ShortName, ex).ConfigureAwait(false);
- throw;
- }
- finally
- {
- activity?.Stop();
+ await next.Send(context).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache<TConsumer>.ShortName, ex).ConfigureAwait(false);
+ throw;
+ }
}
}
}
Index: src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusNamespaceContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusNamespaceContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Contexts/ServiceBusNamespaceContext.cs (date 1568023294778)
@@ -39,7 +39,7 @@
public Task DisposeAsync(CancellationToken cancellationToken = new CancellationToken())
{
- LogContext.Debug?.Log("Closed namespace manager: {Host}", _namespaceManager.Address);
+ LogContext.LogDebug("Closed namespace manager: {Host}", _namespaceManager.Address);
return TaskUtil.Completed;
}
@@ -64,7 +64,7 @@
var created = false;
try
{
- LogContext.Debug?.Log("Creating queue {Queue}", queueDescription.Path);
+ LogContext.LogDebug("Creating queue {Queue}", queueDescription.Path);
queueDescription = await _namespaceManager.CreateQueueAsync(queueDescription).ConfigureAwait(false);
@@ -88,7 +88,7 @@
queueDescription = await _namespaceManager.GetQueueAsync(queueDescription.Path).ConfigureAwait(false);
}
- LogContext.Debug?.Log("Queue: {Queue} ({Attributes})", queueDescription.Path,
+ LogContext.LogDebug("Queue: {Queue} ({Attributes})", queueDescription.Path,
string.Join(", ",
new[]
{
@@ -119,7 +119,7 @@
var created = false;
try
{
- LogContext.Debug?.Log("Creating topic {Topic}", topicDescription.Path);
+ LogContext.LogDebug("Creating topic {Topic}", topicDescription.Path);
topicDescription = await _namespaceManager.CreateTopicAsync(topicDescription).ConfigureAwait(false);
@@ -143,7 +143,7 @@
topicDescription = await _namespaceManager.GetTopicAsync(topicDescription.Path).ConfigureAwait(false);
}
- LogContext.Debug?.Log("Topic: {Topic} ({Attributes})", topicDescription.Path,
+ LogContext.LogDebug("Topic: {Topic} ({Attributes})", topicDescription.Path,
string.Join(", ",
new[] {topicDescription.EnableExpress ? "express" : "", topicDescription.RequiresDuplicateDetection ? "dupe detect" : ""}.Where(x =>
!string.IsNullOrWhiteSpace(x))));
@@ -174,7 +174,7 @@
if (!targetForwardTo.Equals(currentForwardTo))
{
- LogContext.Debug?.Log("Updating subscription: {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.Name,
+ LogContext.LogDebug("Updating subscription: {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.Name,
subscriptionDescription.TopicPath, subscriptionDescription.ForwardTo);
await _namespaceManager.UpdateSubscriptionAsync(description).ConfigureAwait(false);
@@ -191,7 +191,7 @@
var created = false;
try
{
- LogContext.Debug?.Log("Creating subscription {Subscription} {Topic} -> {ForwardTo}", description.Name, description.TopicPath,
+ LogContext.LogDebug("Creating subscription {Subscription} {Topic} -> {ForwardTo}", description.Name, description.TopicPath,
description.ForwardTo);
subscriptionDescription = rule != null
@@ -212,7 +212,7 @@
}
- LogContext.Debug?.Log("Subscription {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.Name,
+ LogContext.LogDebug("Subscription {Subscription} ({Topic} -> {ForwardTo})", subscriptionDescription.Name,
subscriptionDescription.TopicPath, subscriptionDescription.ForwardTo);
return subscriptionDescription;
@@ -228,7 +228,7 @@
{
}
- LogContext.Debug?.Log("Subscription Deleted: {Subscription} ({Topic} -> {ForwardTo})", description.Name, description.TopicPath,
+ LogContext.LogDebug("Subscription Deleted: {Subscription} ({Topic} -> {ForwardTo})", description.Name, description.TopicPath,
description.ForwardTo);
}
}
Index: src/MassTransit.RabbitMqTransport/Pipeline/PrefetchCountFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Pipeline/PrefetchCountFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Pipeline/PrefetchCountFilter.cs (date 1568023295676)
@@ -34,7 +34,7 @@
async Task IFilter<ModelContext>.Send(ModelContext context, IPipe<ModelContext> next)
{
- LogContext.Debug?.Log("Prefetch Count: {PrefetchCount}", _prefetchCount);
+ LogContext.LogDebug("Prefetch Count: {PrefetchCount}", _prefetchCount);
await context.BasicQos(0, _prefetchCount, true).ConfigureAwait(false);
@@ -72,7 +72,7 @@
{
var prefetchCount = context.Message.PrefetchCount;
- LogContext.Debug?.Log("Set Prefetch Count: (count: {PrefetchCount})", prefetchCount);
+ LogContext.LogDebug("Set Prefetch Count: (count: {PrefetchCount})", prefetchCount);
await _modelContext.BasicQos(0, prefetchCount, true).ConfigureAwait(false);
Index: src/MassTransit/Configuration/ConsumerExtensions.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit/Configuration/ConsumerExtensions.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit/Configuration/ConsumerExtensions.cs (date 1568023295666)
@@ -31,7 +31,7 @@
if (consumerFactory == null)
throw new ArgumentNullException(nameof(consumerFactory));
- LogContext.Debug?.Log("Subscribing Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Subscribing Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
var consumerConfigurator = new ConsumerConfigurator<TConsumer>(consumerFactory, configurator);
@@ -57,7 +57,7 @@
if (consumerFactory == null)
throw new ArgumentNullException(nameof(consumerFactory));
- LogContext.Debug?.Log("Connecting Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Connecting Consumer: {ConsumerType} (using supplied consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
IConsumerSpecification<TConsumer> specification = ConsumerConnectorCache<TConsumer>.Connector.CreateConsumerSpecification<TConsumer>();
foreach (IPipeSpecification<ConsumerConsumeContext<TConsumer>> pipeSpecification in pipeSpecifications)
@@ -81,7 +81,7 @@
if (configurator == null)
throw new ArgumentNullException(nameof(configurator));
- LogContext.Debug?.Log("Subscribing Consumer: {ConsumerType} (using default constructor)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Subscribing Consumer: {ConsumerType} (using default constructor)", TypeMetadataCache<TConsumer>.ShortName);
var consumerFactory = new DefaultConstructorConsumerFactory<TConsumer>();
@@ -106,7 +106,7 @@
if (connector == null)
throw new ArgumentNullException(nameof(connector));
- LogContext.Debug?.Log("Connecting Consumer: {ConsumerType} (using default constructor)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Connecting Consumer: {ConsumerType} (using default constructor)", TypeMetadataCache<TConsumer>.ShortName);
return ConnectConsumer(connector, new DefaultConstructorConsumerFactory<TConsumer>(), pipeSpecifications);
}
@@ -128,7 +128,7 @@
if (consumerFactoryMethod == null)
throw new ArgumentNullException(nameof(consumerFactoryMethod));
- LogContext.Debug?.Log("Subscribing Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Subscribing Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
var delegateConsumerFactory = new DelegateConsumerFactory<TConsumer>(consumerFactoryMethod);
@@ -156,7 +156,7 @@
if (consumerFactoryMethod == null)
throw new ArgumentNullException(nameof(consumerFactoryMethod));
- LogContext.Debug?.Log("Connecting Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
+ LogContext.LogDebug("Connecting Consumer: {ConsumerType} (using delegate consumer factory)", TypeMetadataCache<TConsumer>.ShortName);
var consumerFactory = new DelegateConsumerFactory<TConsumer>(consumerFactoryMethod);
@@ -179,7 +179,7 @@
if (consumerFactory == null)
throw new ArgumentNullException(nameof(consumerFactory));
- LogContext.Debug?.Log("Subscribing Consumer: {ConsumerType} (by type, using object consumer factory)",
+ LogContext.LogDebug("Subscribing Consumer: {ConsumerType} (by type, using object consumer factory)",
TypeMetadataCache.GetShortName(consumerType));
var configuratorType = typeof(UntypedConsumerConfigurator<>).MakeGenericType(consumerType);
@@ -206,7 +206,7 @@
if (!consumerType.HasInterface<IConsumer>())
throw new ArgumentException("The consumer type must implement an IConsumer interface");
- LogContext.Debug?.Log("Connecting Consumer: {ConsumerType} (by type, using object consumer factory)", TypeMetadataCache.GetShortName(consumerType));
+ LogContext.LogDebug("Connecting Consumer: {ConsumerType} (by type, using object consumer factory)", TypeMetadataCache.GetShortName(consumerType));
return ConsumerConnectorCache.Connect(connector, consumerType, objectFactory);
}
Index: src/MassTransit.RabbitMqTransport/Pipeline/ConfigureTopologyFilter.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.RabbitMqTransport/Pipeline/ConfigureTopologyFilter.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.RabbitMqTransport/Pipeline/ConfigureTopologyFilter.cs (date 1568023295714)
@@ -57,28 +57,28 @@
Task Declare(ModelContext context, Exchange exchange)
{
- LogContext.Debug?.Log("Declare exchange {Exchange}", exchange);
+ LogContext.LogDebug("Declare exchange {Exchange}", exchange);
return context.ExchangeDeclare(exchange.ExchangeName, exchange.ExchangeType, exchange.Durable, exchange.AutoDelete, exchange.ExchangeArguments);
}
Task Declare(ModelContext context, Queue queue)
{
- LogContext.Debug?.Log("Declare queue {Queue}", queue);
+ LogContext.LogDebug("Declare queue {Queue}", queue);
return context.QueueDeclare(queue.QueueName, queue.Durable, queue.Exclusive, queue.AutoDelete, queue.QueueArguments);
}
Task Bind(ModelContext context, ExchangeToExchangeBinding binding)
{
- LogContext.Debug?.Log("Bind exchange to exchange {Binding}", binding);
+ LogContext.LogDebug("Bind exchange to exchange {Binding}", binding);
return context.ExchangeBind(binding.Destination.ExchangeName, binding.Source.ExchangeName, binding.RoutingKey, binding.Arguments);
}
Task Bind(ModelContext context, ExchangeToQueueBinding binding)
{
- LogContext.Debug?.Log("Bind exchange to queue {Binding}", binding);
+ LogContext.LogDebug("Bind exchange to queue {Binding}", binding);
return context.QueueBind(binding.Destination.QueueName, binding.Source.ExchangeName, binding.RoutingKey, binding.Arguments);
}
Index: src/MassTransit.AzureServiceBusTransport/Contexts/SubscriptionClientContext.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/MassTransit.AzureServiceBusTransport/Contexts/SubscriptionClientContext.cs (revision 5b90f1e06d7a98ad40dd69b70c6b213c981e07b7)
+++ src/MassTransit.AzureServiceBusTransport/Contexts/SubscriptionClientContext.cs (date 1568023394853)
@@ -51,18 +51,18 @@
async Task IAsyncDisposable.DisposeAsync(CancellationToken cancellationToken)
{
- LogContext.Debug?.Log("Closing client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closing client: {InputAddress}", InputAddress);
try
{
if (_client != null && !_client.IsClosed)
await _client.CloseAsync().ConfigureAwait(false);
- LogContext.Debug?.Log("Closed client: {InputAddress}", InputAddress);
+ LogContext.LogDebug("Closed client: {InputAddress}", InputAddress);
}
catch (Exception exception)
{
- LogContext.Warning?.Log(exception, "Close client faulted: {InputAddress}", InputAddress);
+ LogContext.LogWarning(exception, "Close client faulted: {InputAddress}", InputAddress);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment