log4net 存储到oracle 调试 Could not load type [log4net.Appender.OracleAppender]

近期在弄webfrom oracle 调用 log4net 開始调试时不出数据,打开了log4net 自己的debug功能后发现:

log4net: Logger [root] level set to [name="ALL",value=-2147483648].

log4net: Loading Appender [OracleAppender] type: [log4net.Appender.OracleAppender]

log4net:ERROR Could not create Appender [OracleAppender] of type [log4net.Appender.OracleAppender]. Reported error follows.

System.TypeLoadException: Could not load type [log4net.Appender.OracleAppender]. Tried assembly [log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a] and all loaded assemblies

在 log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase)

在 log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean throwOnError, Boolean ignoreCase)

在 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement)

log4net:ERROR Appender named [OracleAppender] not found.

log4net: Adding appender named [InfoAppender] to logger [root].

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,除非你定义。

假设你自己定义。參考我上述应该能够的。

时间: 2024-11-05 15:54:16

log4net 存储到oracle 调试 Could not load type [log4net.Appender.OracleAppender]的相关文章

C#:Could not load type &#39;XXX.Global&#39;

 今天,在从现网代码,转为本地调试的时候,在web.config改过接口之后,忽然发现接口页面弹出这种未加载错误: c#,未能加载类型 Could not load type 'XXX.Global' 很是纳闷,不解,项目没有包含接口么,不对啊,已经包含进去啦,点击http://localhost:5320/端口,同样此错误,很是不解. 然后在网上找了找,发现大部分解决都是删除global文件,然后重新加载.也有的Rebuld成功的. 我这个地方是rebuld不成功,global文件删除倒是

Could not load type &#39;System.ServiceModel.Activation.HttpModule&#39; from assembly &#39;System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#39;

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 问题描述: 再windows server 2008 r2 环境下搭建.net网站 ,运行是IIS7.0提示以上问题 解决方案: 这里需要注册一下ASP.NET 4.

Could not load type &#39;System.Web.Mvc.ViewPage&lt;dynamic&gt;&#39; in asp.net mvc2 after publishing the website

在WebConfig里 找到 <pages></pages> <pages pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System

symfony could not load type &#39;datetime&#39;

当用curd生成控制器后,当修改的时候,会有这个提示,解决方法 在orm中通过事务的方式填充时间,然后把生成的form中的文件的时间段去掉 $builder ->add('title') ->add('keyword') ->add('description') ->add('details') ->add('is_public') ->add('is_activated') ->add('categorya') symfony could not load ty

ASP.NET Parser Error Message: Could not load type &#39;Web.Global&#39;.

Server Error in '/myapp' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. P

网站部署后Parser Error Message: Could not load type 的解决方案

asp.net 的Webproject 项目是在64bit机上开发,默认选项发布后,部署到32bit的服务器上,出现Parser Error Message: Could not load type的错误,主要原因是: 解决方案的编译配置默认情况下是Debug状态,将其切换到All Configurations下,并将目标平台选为Any CPU,重新发布,就能成功,具体操作如下: 右键解决方案--属性,如图配置

解决:Could not load type &#39;System.ServiceModel.Activation.HttpModule&#39; from assemb

解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode 今天我发布项目,获取运行出错如下: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode 解决:Could not load type 'System.Se

Could not load type ‘System.ServiceModel.Activation.HttpModule’ from&amp;

1. 部署网站到IIS7.5,Window 2008的时候出现这个错误 2. 错误信息 Server Error in ‘/’ Application. Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′. 3. 解决

Navicat 连接 Oracle数据库 提示 cannot load OCI DLL 的解决

一.32位系统下 cannot load OCI DLL,126 解决方法:工具->选项->OCI 选择oracle安装目录下bin里面的oci.dll 二 .在64位系统下安装了Oracle 11g,在用Navicat去连接Oracle时,提示以下错误: Cannot load OCI DLL, 126: Instant Client package is required for Baic and TNS connection For more information: http://wi