C#.Net Castle ActiveRecord學習實踐(9):使用ActiveRecord的一些技巧
阿新 • • 發佈:2019-01-26
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<activerecord>
</activerecord>
<log4net>
<!-- Define some output appenders -->
<appener name="trace" type="log4net.Appender.TraceAppender, log4net" >Õ
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%P{user}> - %m%n"/>
</layout>
</appener>Õ
<appener name="console" type="log4net.Appender.ConsoleAppender, log4net" >Õ
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%P{user}> - %m%n"/>
</layout>
</appener>Õ
<appener name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">Õ
<param name="File" value="log.txt"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Date"/>
<param name="DatePattern" value="yyyy.MM.dd"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"/>
</layout>
</appener>Õ
<root>
<!-- priority value can be set to ALL|INFO|WARN|ERROR -->
<priority value="ALL"/>
<appener-ref ref="rollingFile"/>Õ
</root>
</log4net>
<nhibernate>
<!-- with this set to true, SQL statements will output to the console window if it's a console app -->
<add key="hibernate.show_sql" value="true"/>
</nhibernate>
</configuration>
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord"
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<activerecord>
</activerecord>
<log4net>
<!-- Define some output appenders -->
<appener name="trace" type="log4net.Appender.TraceAppender, log4net"
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%P{user}> - %m%n"/>
</layout>
</appener>Õ
<appener name="console" type="log4net.Appender.ConsoleAppender, log4net"
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%P{user}> - %m%n"/>
</layout>
</appener>Õ
<appener name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">Õ
<param name="File" value="log.txt"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Date"/>
<param name="DatePattern" value="yyyy.MM.dd"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"/>
</layout>
</appener>Õ
<root>
<!-- priority value can be set to ALL|INFO|WARN|ERROR -->
<priority value="ALL"/>
<appener-ref ref="rollingFile"/>Õ
</root>
</log4net>
<nhibernate>
<!-- with this set to true, SQL statements will output to the console window if it's a console app -->
<add key="hibernate.show_sql" value="true"/>
</nhibernate>
</configuration>