zoukankan      html  css  js  c++  java
  • log4net 配置

    xml

    <configuration>
      <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
      </configSections>
    
      <log4net>
        <!-- OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL -->
        <!-- Set root logger level to ERROR and its appenders -->
        <root>
          <level value="DEBUG" />
          <appender-ref ref="RollingFileTracer" />
        </root>
        <!-- Print only messages of level DEBUG or above in the packages -->
        <appender name="RollingFileTracer" type="log4net.Appender.RollingFileAppender,log4net">
          <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
          <param name="File" value="App_Data/Log/" />
          <param name="AppendToFile" value="true" />
          <param name="RollingStyle" value="Composite" />
          <param name="MaxSizeRollBackups" value="10" />
          <param name="MaximumFileSize" value="1MB" />
          <param name="DatePattern" value="&quot;Logs_&quot;yyyyMMdd&quot;.txt&quot;" />
          <param name="StaticLogFileName" value="false" />
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
          </layout>
        </appender>
      </log4net>
    </configuration>

     MvcApplication

    log4net.Config.XmlConfigurator.Configure();

    代码

    private static ILog log = LogManager.GetLogger(typeof(ZSZDbContext));
  • 相关阅读:
    求最大公约数
    1013
    实现页面的3D效果
    实现购物车的加减算法
    随机验证码
    深入理解jQuery中的ajax
    canvas粒子时钟
    node、express框架
    vue的增删改查
    实现点击a标签页面跳转后颜色高亮
  • 原文地址:https://www.cnblogs.com/kikyoqiang/p/10847182.html
Copyright © 2011-2022 走看看