-
-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Labels
Description
This should be changed:
Exceptionless.Net/src/Platforms/Exceptionless.NLog/NLogExceptionlessLog.cs
Lines 17 to 22 in 17841c9
public void Error(string message, string source = null, Exception exception = null) { | |
if (LogLevel.Error < MinimumLogLevel) | |
return; | |
_logger.ForErrorEvent().Message(message).LoggerName(source).Log(); |
To this:
_logger.ForErrorEvent().Message(message).LoggerName(source).Exception(exception).Log();
Notice it is a little special that you modify the LoggerName
, since this is usually derived from _logger
. Can see that log4net
does the following:
NLog.LogManager.GetLogger(source ?? GetType().ToString()).ForErrorEvent().Message(message).Exception(exception).Log(typeof(NLogExceptionlessLog));
Any reason why not doing the same for NLog ?
P.S the reason for using .Log(typeof(NLogExceptionlessLog))
is to make NLog Callsite work correctly.