【发布时间】:2011-01-11 01:00:42
【问题描述】:
我在几个地方读到 log4net threadContext 在 asp.net 场景中使用是不安全的。这里有几篇文章:
Log4Net, ThreadContext, and Global.asax
http://piers7.blogspot.com/2005/12/log4net-context-problems-with-aspnet.html
所以我的方案是我想在 IIS 中托管的 WCF 层中使用 threadContext。线程上下文会好吗?我认为“单一”的并发模式可以做到这一点。
【问题讨论】:
-
有什么理由使用 log4net 而不是 MS Enterprise Library Logging 块?这适用于 asp.net / IIS 托管的 WCF 服务,并且每一点都可配置。
标签: asp.net wcf iis log4net threadcontext