iBatis.Net 配置 SQL语句执行 日志
<configuration> <configSections> ...
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> <sectionGroup name="iBATIS"> <section name="logging" type="IBatisNet.Common.Logging.ConfigurationSectionHandler, IBatisNet.Common" /> </sectionGroup> ... </configSections> ... <iBATIS> <logging> <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, IBatisNet.Common.Logging.Log4Net"> <arg key="configType" value="inline" /> </logFactoryAdapter> </logging> </iBATIS> <log4net> <!-- Define some output appenders --> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <param name="File" value="Log4Net\Log4Net" /> <param name="AppendToFile" value="true" /> <param name="MaxSizeRollBackups" value="2" /> <param name="MaximumFileSize" value="100KB" /> <param name="RollingStyle" value="Size" /> <param name="StaticLogFileName" value="true" /> <layout type="log4net.Layout.PatternLayout"> <param name="Header" value="[Header]\r\n" /> <param name="Footer" value="[Footer]\r\n" /> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" /> </layout> </appender> <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" /> </layout> </appender> <!-- Set root logger level to ERROR and its appenders --> <root> <level value="DEBUG" /> <appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="ConsoleAppender" /> </root> <!-- Print only messages of level DEBUG or above in the packages --> <logger name="IBatisNet.DataMapper.Configuration.Cache.CacheModel"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.DataMapper.LazyLoadList"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.DataAccess.DaoSession"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.DataMapper.SqlMapSession"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.Common.Transaction.TransactionScope"> <level value="DEBUG" /> </logger> <logger name="IBatisNet.DataAccess.Configuration.DaoProxy"> <level value="DEBUG" /> </logger> </log4net> ... </configuration>