使用自定义"PatternLayout"时,log4net会将"异常"信息(如果存在)附加到每个日志条目.我试图控制消息的输出和堆栈跟踪信息,并希望"抑制"此信息.我已经四处寻找但无法找到办法.有任何想法吗?
示例web.config条目(对于RollingFileAppender):
<layout type="Example.Class.CustomLog4netLayouts,Example">
<conversionPattern value="%date [%thread] [RID:%property{CLIENT_REQUESTID}]
%-5level %logger [%property{NDC}] - %cleanmessage - %cleanstack%newline" />
</layout>
Run Code Online (Sandbox Code Playgroud)
谢谢