gpt4 book ai didi

log4net - CustomAppendar中LoggingEvent中的LocationInformation

转载 作者:行者123 更新时间:2023-12-02 04:03:29 25 4
gpt4 key购买 nike

我已经编写了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;

关于log4net - CustomAppendar中LoggingEvent中的LocationInformation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8903291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com