【发布时间】:2012-10-03 01:31:37
【问题描述】:
可能重复:
How to get the Stack trace when logging exceptions with NLog?
抛出异常以从日志中获得清晰图像的最佳做法是什么?
对于日志记录,我使用的是 NLog。
下面是简单的代码:
catch (Exception ex)
{
logger.Fatal(ex.Message);
throw new Exception(ex.Message);
}
它没有给我一个好的日志信息。我需要诸如函数、错误代码行之类的信息。
【问题讨论】: