登录使用的InnerException log4net的 [英] Logging InnerException using Log4Net
问题描述
我如何记录与log4net的?
内部异常这是我目前的转换方法:
< conversionPattern值=%DATE [%的AppDomain]%-5level%记录[%属性{NDC}] - %消息%换行/>
控制台和文件附加目的地自动打印例外。唯一的例外:消息,堆栈跟踪,以及所有内部异常(再次堆栈跟踪)登录不同的线,也不要跟随转换模式
我甚至不知道你可以配置log4net的不打印。
更新:的 它可以配置附加器不打印栈跟踪: <一href="http://stackoverflow.com/questions/3659271/log4net-logging-out-the-exception-stacktrace-only-for-certain-files/3660529#3660529">Log4Net - 注销异常堆栈跟踪仅适用于特定的文件
How do I log inner exception with Log4NET?
This is my current conversion pattern:
<conversionPattern value="%date [%appdomain] %-5level %logger [%property{NDC}] - %message%newline" />
Console and File Appenders automatically print the exception. The exception: message, stack trace, and all inner exceptions (again with stack trace) are logged on separate lines and do not follow the conversion pattern.
I am not even sure if you could configure log4net not to print it.
Update: It is possible to configure the appender to not print the stacktrace: Log4Net - Logging out the Exception stacktrace only for certain files
这篇关于登录使用的InnerException log4net的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!