What do you have in your log4net config? Hacks, optimizations, observations?

前端 未结 6 2066
悲哀的现实
悲哀的现实 2021-01-30 09:25

This is my log4net config file



  

        
6条回答
  •  借酒劲吻你
    2021-01-30 10:05

    I run a pretty minimal log4net configuration and prefer to use the XML format, but one thing I'd suggest adding (for web apps) is the ASP.NET trace appender. You simply have to add the following:

    
       
    
    

    Then down at your root logger, or wherever you decide to activate it:

    
       
       
       
    
    

    This allows me to get all of my pertinent debug data together on a single page when I'm debugging some minute ASP.NET details. Most of the time I have the ASP.NET trace appender commented out to disable it, but has really helped out in a few instances, especially when you're trying to figure out what particular server post back method is causing the hangup in your app.

提交回复
热议问题