近期在弄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,除非你定义。

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

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

  1. log4net报错Could not load type 'System.Security.Claims.ClaimsIdentity'

    使用log4net,在win7上可以正常使用,但是在部分xp电脑上可以生成access数据库,但是无法写数据到mdb 排除了程序原因,怀疑是xp缺少什么dll之类的 偶然查到log4net的调试方法: ...

  2. install_driver(Oracle) failed: Can't load `.../DBD/Oracle/Oracle.so' for module DBD::Oracle

    Description This section is from the "Practical mod_perl " book, by Stas Bekman and Eric C ...

  3. Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c

    错误: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, V ...

  4. TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.2.0 ...

    今天调试 asp.net core 2.0 项目时遇到了如下错误: TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.I ...

  5. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, ...

  6. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'

    [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...

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

    asp.net 的Webproject 项目是在64bit机上开发,默认选项发布后,部署到32bit的服务器上,出现Parser Error Message: Could not load type的 ...

  8. 解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assemb

    解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode ...

  9. Unable to load type System.Data.Entity.DynamicProxiesXXXXXrequired for deserialization.

    Memcache实例的Get方法时抛出了异常“Unable to load type System.Data.Entity.DynamicProxies.AdInfoItems_19CD09C8E46 ...

随机推荐

  1. 使用(function() {}).call(this);包裹代码有什么好处,什么时候应该这样做?

    转自:http://segmentfault.com/q/1010000002519489 1.严格模式下函数调用的 this 并不会默认成为全局对象. 使用 func.call(this) 确保函数 ...

  2. CIF、QCIF

    分辨率: 每个像素的存储方式都是YUV   QQCIF:88*72 QCIF:176*144 CIF:352*288 2CIF:704*288 DCIF:584*384 4CIF:704*576   ...

  3. 日媒:阿里巴巴上市融资或超Facebook

    <日本经济新闻>4月22日报导称, 越来越多观念以为,正准备在美国股票商场上市的阿里巴巴集团的融资额将超越美国Facebook.假如完毕,作为互联网公司将创出融资额的历史新高.阿里巴巴现已 ...

  4. Visual Studio使用中的问题

    1.后台断点调试,一到断点的时候就VS已停止 原因:安装插件问题,我的由于安装了" .NET Reflector Visual Studio Extension "插件 解决办法: ...

  5. IOS学习笔记45--UITableView性能优化

    说实话,面试的时候已经被问到几次这个问题,然后就搜索了一下,看到了这篇优化文章,感觉不错,转来日后作为一种UITableView优化的方法. 使用不透明视图.      不透明的视图可以极大地提高渲染 ...

  6. 4667 Building Fence 解题报告

    题意:给n个圆和m个三角形,且保证互不相交,用一个篱笆把他们围起来,求最短的周长是多少. 解法1:在每个圆上均匀的取2000个点,求凸包周长就可以水过. 解法2:求出所有圆之间的外公切线的切点,以及过 ...

  7. 与AQS有关的并发类

    ReetrantLock与Condition: 參考 在java.util.concurrent包中.有两个非常特殊的工具类.Condition和ReentrantLock,使用过的人都知道,Reen ...

  8. javaweb笔记全套

    Lesson 1 一.eclipse工具的使用 1. java代码的位置 1) 选择工作空间 workspace  选择一个文件夹存放程序(代码) 不要用中文和空格 2) 新建一个java 工程(Pr ...

  9. js立即执行函数应用--事件绑定

    js中立即执行函数的应用:应用到事件绑定上. 少说多做,直接运行代码(代码中有注释): <!DOCTYPE html> <html lang="zh"> & ...

  10. global语句(python学习手册422页)

    # -*- coding: cp936 -*- #python 27 #xiaodeng #global语句(python学习手册422页) #实际上就是一个名为__builtin__的模块,但是必须 ...