Can't get Log4Net to work in my ASP.NET website :(

后端 未结 5 1440
终归单人心
终归单人心 2021-02-10 13:22

really simple question -> i can\'t seem to get any data from Log4Net in my ASP.NET application. I\'ve got a simple ASP.NET website, which references a class library. In this cla

5条回答
  •  借酒劲吻你
    2021-02-10 14:17

    Ok, found the answer. I needed to use a TraceAppender.

    The application configuration file can be used to control what listeners are actually used. See the MSDN documentation for the Trace class for details on configuring the trace system.

    Events are written using the System.Diagnostics.Trace.Write(string,string) method. The event's logger name is passed as the value for the category name to the Write method.

    Here's my config file data...

    
        
            
                
            
        
    
    
        
        
            
            
        
    
    

提交回复
热议问题