How to log MethodName when wrapping Log4net?

后端 未结 10 1719
说谎
说谎 2020-11-29 23:41

I have wrapped Log4net in a static wrapper and want to log

loggingEvent.LocationInformation.MethodName
loggingEvent.LocationInformation.ClassName
         


        
10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 00:31

    How about C#4.5 feature callerinfo - http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callermembernameattribute.aspx

提交回复
热议问题