惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

博客园 - 暗香浮动

quartz.net 项目无法加载的问题 wcf的诡异问题 获取iTextSharp 的image 报错 FastReport 隐藏matrix的列如何实现 获取FileStream物理文件位置 log4net 1.2.11.0 的一点更新 无法更改数据库最大线程数 Moss文件操作速度慢的问题解决记录 无法更改数据库最大线程数 windows 服务循环任务.服务启动后无法停止重启的解决办法 单用户模式恢复到多用户模式. mssql 数据库还原脚本 让客户ie8浏览器默认使用ie7兼容模式 - 暗香浮动 - 博客园 Package load Analyzer Create two fload when i run vs2008.here is solution to stop this. vss 命令行unpin批量操作 及vss的bug补丁 wf数据库Tracking服务 数据库表详解 生成随机字符串的问题 截断css影响的问题 clrprofile造成的日志肿瘤问题解决
webconfig中配置log4net 数据访问及业务层使用
暗香浮动 · 2009-05-07 · via 博客园 - 暗香浮动

遇到了标题所示的问题。baidu google之。未果,csdn上有人问过这个问题但是没有任何回答。

研究了下  记之如下

webconfig中在<configuration></configuration>标签中写入:

Code


AssemblyInfo.cs中加入:

[assembly: log4net.Config.XmlConfigurator (ConfigFile="Web.config",Watch=true)]


示例页面中引用log4net,需要写日志的地方加入如下代码:

log4net.ILog log = log4net.LogManager.GetLogger("Logger");
log.Debug(
"价格策略异常");

运行在web应用程序的bin下生成日志文件log-file.txt