我已经编写了custon Appendar,并重写了Append方法。我在该方法中获取LoggingEvent,但是当我查看LocationInformation为空时,它仅显示“?”在以下属性中。

protected override void Append(log4net.Core.LoggingEvent loggingEvent)
{

ClassName = loggingEvent.LocationInformation.ClassName /*contains "?"*/,
MethodName = loggingEvent.LocationInformation.MethodName /*contains "?"*/,
FileName = loggingEvent.LocationInformation.FileName /*contains "?"*/,
FullInfo = loggingEvent.LocationInformation.FullInfo /*contains "?"*/,

}

我做错了什么?

谢谢

最佳答案

您能否尝试在自定义附加程序的构造函数中添加以下行:

Fix = FixFlags.All;

10-01 19:34