Log4net - Suppress “exception” from being appended to custom “PatternLayout”

前端 未结 1 462
感动是毒
感动是毒 2021-01-17 16:48

When using a custom \"PatternLayout\", log4net is appending the \"exception\" information (when present) to every log entry. I am trying to control the output of the message

相关标签:
1条回答
  • 2021-01-17 16:59

    Configure the layout like this:

    <layout type="Example.Class.CustomLog4netLayouts,Example">
        <IgnoresException value="False" />
        ...
    

    Setting IgnoresException to false tells the appender that the layout will take care of the exception. Thus you can choose not to print the stack trace.

    0 讨论(0)
提交回复
热议问题