1
我在修改传统的asp.net项目。我想包括一些名称空间,类和方法的透明日志记录。用EntLib在ASP.NET中透明记录
我使用EntLib。我可以配置警察注射设置以透明地记录我的应用程序吗我必须做什么才能将所有方法记录在指定的命名空间中?
它是我的web.config的一部分。
<policyInjection>
<policies>
<add name="Policy">
<matchingRules>
<add type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.NamespaceMatchingRule, Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Namespace Matching Rule">
<matches>
<add match="MyNamespace.*" ignoreCase="true" />
</matches>
</add>
</matchingRules>
<handlers>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.PolicyInjection.LogCallHandler, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
beforeMessage="+++AOP " afterMessage=" AOP+++" name="Logging Call Handler">
<categories>
<add name="General" />
</categories>
</add>
</handlers>
</add>
</policies>
任何人有反应 –