我将log4net与.NET Common.Logging 一起使用。我配置了一个消息模式以包含方法和类名,如下所示:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5level [%M %C] - %message%newline" />
</layout>
问题是我总是得到 Common.Logging 方法和类的名称:
FATAL [Fatal Common.Logging.Factory.AbstractLogger] - log message
INFO [Info Common.Logging.Factory.AbstractLogger] - log message
DEBUG [Debug Common.Logging.Factory.AbstractLogger] - log message
这是最没用的。有没有办法打印我的方法名称?