log4net Web. config configuration

Source: Internet
Author: User
Tags log4net

1, [Assembly:log4net. Config.xmlconfigurator (configfile = "Web. config", Watch = true)] writes to AssemblyInfo.cs in the custom log class

<configSections> <!--Add log4net configuration section--<section name= "log4net" type= "log4net.        Config.log4netconfigurationsectionhandler,log4net "/> </configSections> <!--settings log4net configuration section-- <log4net> <!--output to file--<appender name= "Rollingfile" type= "log4net.            Appender.rollingfileappender,log4net "> <param name=" File "type=" "value=" C:\testlog\log.txt "/>            <param name= "Appendtofile" value= "true"/> <param name= "Staticlogfilename" value= "true"/> <!--scrolling: By date-<param name= "Rollingstyle" value= "date"/> <param name= "Da             Tepattern "value=" YyyyMMdd "/> <!--scrolling mode: By log size <param name=" Rollingstyle "value=" size "/> <param name= "maxsizerollbackups" value= "2MB/> <param name=" maximumfilesize "value="/&                    Gt --<layout type= "log4net. Layout.patternlayout,log4net "> <param name=" Header "value=" "/> <param name=" Foo ter "value=" "/> <param name=" Conversionpattern "value="%n%date [Thread Id:%thread] File:%file [%line]%-5le        Vel%logger [priority:%PROPERTY{NDC}]----%n "error message"%m%n%n "/> </layout> </appender>     <root> <level value= "All"/> <appender-ref ref= "Rollingfile"/> </root> </log4net>

  

log4net Web. config configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.