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

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

博客园 - HollisYao

创建Azure DS 虚拟机并附加SSD硬盘 Azure Site to Site VPN 配置手册 - HollisYao 使用Azure REST API创建虚拟机 SharePoint 2013 地址栏_layouts/15/start.aspx# SharePoint 2013 Workflow Manager 工作流配置注意事项 InfoPath 发布表单到SharePoint库报错 InfoPath发布到SharePoint Server 2013报错 在log4net中控制nhibernate输出 VMWare host 32位 guest 64位 QuickPart Permission问题 ASP.Net 域自动登录(AD自动登录) - HollisYao - 博客园 Feature部署EventHandler注意事项 QuickPart功能改进_Sharepoint_MOSS 部署WebPart的两种方式 MOSS/Sharepoint 2007 创建网站集之后,链接出现“未找到文件”错误提示 Apache2.2.8、php5.2.6、mysql5、phpMyAdmin2.11.6在Windows Vista下的安装和配置 Vista SP1、IIS7,安装ASP.Net 1.1、VS2003、NetAdvantage 2004vol、Sql Server2000全攻略 博客园怎么了? 将 MS SQL Server 2005 SP2 整合到安装文件--【脚本修正】
log4net+spring.net+Nhibernate 内部异常捕捉问题
HollisYao · 2010-05-21 · via 博客园 - HollisYao

当使用log4net+spring.net+Nhibernate组合的时候,如果发生异常,经过层层传递,以及Spring对异常的包装,如果直接使用

                LogManager.GetLogger(typeof(_Default)).Error(ex.Message, ex);

来记录异常信息的话,通常记录不了,猜测的原因(并没有深究。。。):ex有内部异常,且这个异常经过了nhibernate和spring包装之后,log4net无法从内部堆栈中找出最原始的异常,所以导致log4net记录不了这个异常,那么我们就采用以下形式记录:

                LogManager.GetLogger(typeof(_Default)).Error(ex.Message, ex.InnerException == null ? ex : ex.InnerException);

就能解决这个问题!