标签:log4net oracle webform debug .net
最近在弄webfrom oracle 调用 log4net 开始调试时不出数据,打开了log4net 自己的debug功能后发现:
log4net: Logger [root] level set to [name="ALL",value=-2147483648].
log4net: Loading Appender [OracleAppender] type: [log4net.Appender.OracleAppender]log4net: Hierarchy Threshold []
<log4net>
<!--<appender name="OracleAppender" type="log4net.Appender.OracleAppender">--> 发现把这句改成下面这句就ok了。
<appender name="AdoNetAppender_Oracle" type="log4net.Appender.AdoNetAppender">
<bufferSize value="1" />
<!--<connectionType value="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=2.0.50727.3053, Culture=neutral, PublicKeyToken=b77a5c561934e089" />-->
<!--<connectionType value="Oracle.DataAccess.Client.OracleConnection, System.Data.OracleClient, Version=2.0.50727.3053, Culture=neutral, PublicKeyToken=b77a5c561934e089" />-->
<connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient" />
<connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient" />
<connectionString value="DATA SOURCE=ORCL;USER ID=BEFORVIPRESET;PASSWORD=BEFORVIPRESET"/>
<commandText value="INSERT INTO BEFORVIPRESET.YHJ_LOG4NET (LOG_ID, LOG_DATE, LOG_LEVEL, LOG_IDENTITY, LOG_MESSAGE, LOG_EXCEPTION, LOG_LOGGER, LOG_SOURCE) VALUES (YHJ_LOG4NET_SEQ.nextval, :log_date, :log_level, :log_identity,
:log_message, :log_exception, :logger, :source)" />
<parameter>
<parameterName value=":log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout">
<conversionPattern value="%d{yyyy/MM/dd HH:mm:ss}" />
</layout>
</parameter>
<parameter>
<parameterName value=":log_level" />
<dbType value="String" />
<size value="10" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
<parameter>
<parameterName value=":log_identity" />
<dbType value="String" />
<size value="100" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%identity" />
</layout>
</parameter>
<parameter>
<parameterName value=":log_message" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m" />
</layout>
</parameter>
<parameter>
<parameterName value=":log_exception" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%exception" />
</layout>
</parameter>
<parameter>
<parameterName value=":logger" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout>
</parameter>
<parameter>
<parameterName value=":source" />
<dbType value="String" />
<size value="1000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%file:%line" />
</layout>
</parameter>
</appender>
其中log4net里面只有AdoNetAppender 而没有OracleAppender,除非你定义。如果你自定义,参考我上述应该可以的。
版权声明:本文为博主原创文章,未经博主允许不得转载。
log4net 存储到oracle 调试 Could not load type [log4net.Appender.OracleAppender]
标签:log4net oracle webform debug .net
原文地址:http://blog.csdn.net/handsome1234/article/details/47093005