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

前端 未结 1 485
感动是毒
感动是毒 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:

    
        
        ...
    

    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)
提交回复
热议问题