标签:
protected void Application_Start() { log4net.Config.XmlConfigurator.Configure(); }
3. 在web.config 中configuration 节点中 加入如下配置
<configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections> <log4net> <appender name="NHibernateFileLog" type="log4net.Appender.FileAppender"> <file value="logs/nhibernate.txt" /> <appendToFile value="false" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fff} [%t] %-5p %c - %m%n" /> </layout> </appender> <logger name="NHibernate.SQL" additivity="false"> <level value="DEBUG"/> <appender-ref ref="NHibernateFileLog"/> </logger> </log4net> </configuration>
标签:
原文地址:http://www.cnblogs.com/wuyicqb/p/4976008.html