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>
任何人有反應 –