Log4NET Oracle 配置
下面是配置文件 以后就直接复制了 免的重写
<?xml version="1.0" encoding="utf-8" ?> <log4net> <logger name="OracleLogger"> <level value="ERROR" /> <appender-ref ref="ADONetAppender_OracleServer" /> </logger> <appender name="ADONetAppender_OracleServer" type="log4net.Appender.AdoNetAppender"> <bufferSize value="1" /> <connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=2.0.4.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <connectionString value="Data Source=数据库;User ID=用户名;Password=密码;pooling=true;max pool size=1000" /> <commandText value="INSERT INTO LOG(DATATIME,INFO) VALUES(:LOGDATE,:LOGINFO)" /> <parameter> <parameterName value=":LOGDATE" /> <dbType value="DateTime" /> <layout type="log4net.Layout.RawTimeStampLayout" /> </parameter> <parameter> <parameterName value=":LOGINFO" /> <dbType value="String" /> <size value="4000" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="线程:%t;%n级别:%-10p %n异常:%m%n---->%exception" /> </layout> </parameter> </appender> </log4net>