Having a log per day

后端 未结 3 1659
伪装坚强ぢ
伪装坚强ぢ 2020-12-08 13:20

Currently my application is using log4net to log errors, the web.config for this is as followed:

 
            


        
3条回答
  •  心在旅途
    2020-12-08 13:45

    Like using the RollingFileAppender

    
        
        
        
        
        
         
        
    
    

    edit

    This is the whole log4net configuration section to roll everyday, the same as @lazyberezovsky answered just adding the log4net and root for clarification

    edit2 this will create a file named 'gateway_' and at the end of the day (2012-04-27) it will be renamed as gateway_20120427.log and the next day (2012-04-28) it will create again the file gateway_ and at the end it'll create gateway_20120428.log.

     
        
            
            
            
            
            
                
            
        
    
        
            
            
        
    
    

提交回复
热议问题