Log4net logs are stored locally, while log4net logs are stored locally.

Source: Internet
Author: User
Tags date1 log4net

Log4net logs are stored locally, while log4net logs are stored locally.

<? Xml version = "1.0" encoding = "UTF-8"?> <Configuration> <configSections> <section name = "log4net" type = "log4net. Config. Log4NetConfigurationSectionHandler, log4net"/> </configSections> <! -- Log4net Begin --> <log4net> <root> <! -- Control level, from low to high: all | debug | info | warn | error | fatal | off --> <level value = "All"/> <appender-ref = "rollinglogfileappender"/> <appender-ref = "leleappender"/> <appender-ref = "adonetappender_mysql"/> </root> <! -- <Logger name = "LogWriter"> <level value = "ALL"/> <appender-ref = "ADONetAppender"/> <appender-ref = "RollingLogFileAppender"/> </logger> --> <appender name = "AdoNetAppender_MySql" type = "log4net. appender. ADONetAppender "> <bufferSize value =" 1 "/> <connectionType value =" MySql. data. mySqlClient. mySqlConnection, MySql. data "/> <connectionString value =" server = 172.16.13.165; user id = microask; pwd = 123456; p Ort = 3306; pooling = True; database = microask2 "providerName =" MySql. data. mySqlClient; "/> <commandText value =" insert into t_system_log (Date1, Thread, Level, Logger, Message, Exception) VALUES (@ Date1, @ Thread, @ Level, @ Logger, @ Message, @ Exception) "/> <parameter> <parameterName value =" @ Date1 "/> <dbType value =" String "/> <layout type =" log4net. layout. rawTimeStampLayout "/> </parameter> <paramet ErName value = "@ Thread"/> <dbType value = "String"/> <size value = "100"/> <layout type = "log4net. layout. patternLayout "> <conversionPattern value =" % thread "/> </layout> </parameter> <parameterName value =" @ Level "/> <dbType value =" String & quot;/> <size value = "100"/> <layout type = "log4net. layout. patternLayout "> <conversionPattern value =" % level "/> </layout> </parameter> <parameterNa Me value = "@ Logger"/> <dbType value = "String"/> <size value = "100"/> <layout type = "log4net. layout. patternLayout "> <conversionPattern value =" % logger "/> </layout> </parameter> <parameterName value =" @ Message "/> <dbType value =" String & quot;/> <size value = "1000"/> <layout type = "log4net. layout. patternLayout "> <conversionPattern value =" % message "/> </layout> </parameter> <parameterN Ame value = "@ Exception"/> <dbType value = "String"/> <size value = "4000"/> <layout type = "log4net. layout. predictionlayout "/> </parameter> </appender> <! -- Setup the root category, add the appenders and set the default level --> <appender name = "RollingLogFileAppender" type = "log4net. appender. rollingFileAppender "> <param name =" File "value =" Log \ background log.txt "/> <param name =" AppendToFile "value =" true "/> <param name =" RollingStyle "value =" Date "/> <param name =" DatePattern "value =" yyyyMMdd "/> <param name =" StaticLogFileName "value =" true "/> <layout type = "l Og4net. layout. patternLayout, log4net "> <param name =" ConversionPattern "value =" % d [% t] %-5 p % c % m % n "/> <param name =" Header "value = "----------------------- header handler"/> <param name = "Footer" value = "--------------------- footer notebook"/> </layout> </appender> <appender name = "leleappender type "= "log4net. appender. consoleAppender "> <layout type =" log4net. layo Ut. patternLayout "> <param name =" ConversionPattern "value =" % d [% t] %-5 p % c % m % n "/> </layout> </appender> <! -- Setup the root category, add the appenders and set the default level --> </log4net> <! -- Log4net End --> </configuration>

 

Related Article

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.