Commit 1d7f2b19 authored by Savorboard's avatar Savorboard

refactor and modify logs content.

parent 05f6e661
...@@ -65,7 +65,7 @@ namespace DotNetCore.CAP.Processor ...@@ -65,7 +65,7 @@ namespace DotNetCore.CAP.Processor
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.ExceptionOccuredWhileExecuting(message.Name, ex); _logger.LogError(ex, $"An exception occurred when sending a message to the MQ. Topic:{message.Name}, Id:{message.Id}");
} }
} }
} }
...@@ -82,14 +82,7 @@ namespace DotNetCore.CAP.Processor ...@@ -82,14 +82,7 @@ namespace DotNetCore.CAP.Processor
{ {
foreach (var message in _receivedMessageQueue.GetConsumingEnumerable(_cts.Token)) foreach (var message in _receivedMessageQueue.GetConsumingEnumerable(_cts.Token))
{ {
try _executor.ExecuteAsync(message);
{
_executor.ExecuteAsync(message);
}
catch (Exception ex)
{
_logger.ExceptionOccuredWhileExecuting(message.Name, ex);
}
} }
} }
catch (OperationCanceledException) catch (OperationCanceledException)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment