log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [File] to set object on [TF.Log.FileAppender]
难受,香菇。
大概研究了两个多小时,搜了很多资料都没有很完美的答案,最后突然脑子就一闪一闪,才弄明白咋回事。
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [File] to set object on [TF.Log.FileAppender]
背景:我们遵循了适配器模式,为log4net在外面又包装了一层。外面那层名称为我上面错误显示的:TF.Log
和 log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [locationInfo] to set object on [log4net.Layout.PatternLayout]
其实是相似的错误,所以不要惊讶我的名字为何和log4net不一样。
咳咳~~接下来就要说正事了,请小盆友们排排坐,仔细瞅!!!
在log4net.config配置文件里面你可以随意添置节点。
eg:
其中在这里的FileAppender类是我自己写的。
由于我没有在我自己写的FileAppender的里面添加上File属性,与配置文件里面的File对应起来,所以就说没有在FileAppender里面找到File节点。
解决方案:前提是自定义文件的话。如果你想在源码上修改。需要找到log4net项目中的FileAppender文件,进行修改。

由于还是菜鸟,里面有很多东西还没有研究透,以上若有不足,请多多指教,及时修改。
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [File] to set object on [TF.Log.FileAppender]的更多相关文章
- Extending JMeter – Creating Custom Config Element – Property File Reader
JMeter is one of the best open source tools in the Test Automation Community. It comes with all the ...
- (转)win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
原文地址:http://www.cnblogs.com/fnng/p/4115607.html 作者:虫师 今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-pyth ...
- win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-python 时报错: _mysql.c _mysql.c(42) : fatal error C1083: Can ...
- [转] --- Error: “A field or property with the name was not found on the selected data source” get only on server
Error: “A field or property with the name was not found on the selected data source” get only on ser ...
- Error: Cannot open main configuration file '//start' for reading! 解决办法
当执行service nagios start启动nagios时,报错:Error: Cannot open main configuration file '//start' for reading ...
- ERROR: “System.Web.Mvc.Controller.File(string, string, string)”是一个“方法”
ERROR: “System.Web.Mvc.Controller.File(string, string, string)”是一个“方法”,这在给定的上下文中无效 这是一个与Controller.F ...
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决 mysql安装python
在win7下安装了Python后,想安装python-MySQL,使用pip安装出现如下问题: >pip install MySQL-python _mysql.c(42) : fatal er ...
- WebViewer报错Error loading document: Invalid XOD file: Zip end header data is wrong size!
错误:Error loading document: Invalid XOD file: Zip end header data is wrong size! 解决:https://groups.go ...
- 【MySQL】InnoDB: Error: checksum mismatch in data file 报错
参考:http://www.jb51.net/article/66951.htm 用5.7版本启动原5.5实例后,再用5.5启动出现以下报错 InnoDB: Error: checksum misma ...
随机推荐
- 使用CAS实现无锁列队-链表
#include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <iostream& ...
- ASP.NET开发中修改代码而不重启网站
我们在做网站开发的时候,通常是写好了一个功能就要进行测试,Visual Studio上点“Start Debugging”(快捷键是F5),这是调试模式,也有直接运行模式,“Start Without ...
- Activity 之生命周期
Activity 之生命周期 本文内容: 1. Activity 介绍 2. Activity 的生命周期 2.1 生命周期图 2.2 常见情况下生命周期的回调 2.3 关于生命周期常见问题 2.4 ...
- Elasticsearch Index模块
1. Index Setting(索引设置) 每个索引都可以设置索引级别.可选值有: static :只能在索引创建的时候,或者在一个关闭的索引上设置 dynamic:可以动态设置 1.1. S ...
- .NET Core微服务之基于Polly+AspectCore实现熔断与降级机制
Tip: 此篇已加入.NET Core微服务基础系列文章索引 一.熔断.降级与AOP 1.1 啥是熔断? 在广义的解释中,熔断主要是指为控制股票.期货或其他金融衍生产品的交易风险,为其单日价格波动幅度 ...
- Ubuntu16.04 部署配置GO语言开发环境 & 注意事项
1. 安装GO 安装go语言包: $ curl -O https://storage.googleapis.com/golang/go1.10.1.linux-amd64.tar.gz 下载完成后 ...
- 【Android Studio安装部署系列】十四、Android studio移除工程和删除项目
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio删除工程.项目的操作步骤. 移除工程 主要用于从最近打开的项目列表中移除.硬盘中还是存在这个项目的. F ...
- 今天筹备了一件大事:重学JS
最近在阮大神的博客上看到一篇文章,讲的是关于如何自学计算机技术,原文出自 Teach Yourself Computer Science.看完以后我明白自己的缺陷在哪里,基础不够牢固是我最大的问题. ...
- Angular开发技巧
由于之前有幸去参加了ngChina2018开发者大会,听了will保哥分享了Angular开发技巧,自己接触Angular也有差不多快一年的时间了,所以打算对Angular开发中的一些技巧做一个整理 ...
- 全文检索-Elasticsearch (四) elasticsearch.net 客户端
本篇摘自elasticsearch.net search入门使用指南中文版(翻译) 原文:http://edu.dmeiyang.com/book/nestusing.html elasticsear ...