Closed spudwebb closed 4 years ago
For example:
Log.Error("Synchronous command send failed due to unexpected exception.", ex);
will not log the exception as there is no parameter in the message template. So we should replace it with:
Log.Error("Synchronous command send failed due to unexpected exception. {Exception}", ex);
or I saw that Serilog also have methods that takes an exception as the first parameter:
public static void Error(Exception exception, string messageTemplate);
but I'm not sure how it works.
For example:
Log.Error("Synchronous command send failed due to unexpected exception.", ex);
will not log the exception as there is no parameter in the message template. So we should replace it with:
Log.Error("Synchronous command send failed due to unexpected exception. {Exception}", ex);
or I saw that Serilog also have methods that takes an exception as the first parameter:
public static void Error(Exception exception, string messageTemplate);
but I'm not sure how it works.