PostSharp Diagnostics Toolkit - Can the message format be changed?

筅森魡賤 提交于 2019-12-11 10:32:40

问题


I'm using the PostSharp Diagnostics Toolkit with Log4Net and it is working verynicely. However, the output contains the namespace and class twice on each line.

Log4Net is configured to use a standard pattern layout

<layout type="log4net.Layout.PatternLayout">
  <conversionPattern value="%date [%thread] %level %logger - %message%newline" />
</layout>

This is producing the output:

2012-11-15 11:03:22,992 [ServerScheduler_Worker-3] DEBUG MyNamespace.MyClass - Entering: MyNamespace.MyClass.MyMethod(DateTime date = {11/15/2012 00:00:00})

Notice MyNamespace.MyClass is repeated. I do want Log4Net to output the %logger (namespace and class) for log statements not injected by by PostSharp.

How can I configure PostSharp to only output the method name rather than the full namespace.classname.methodname?


回答1:


This is a good point. It is not possible to customize it currently. I added a user story to our backlog.



来源:https://stackoverflow.com/questions/13402206/postsharp-diagnostics-toolkit-can-the-message-format-be-changed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!