Log4Net - Logging out the Exception stacktrace only for certain files

后端 未结 2 1846
[愿得一人]
[愿得一人] 2020-12-05 00:36

I currently have multiple log files in my application using log4net.

I have a top level log file which contains every type of message. I also have an error log file

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 01:36

    Configure the layout like this (GeneralTextLog Appender):

    
        
        ...
    

    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.

提交回复
热议问题