Can you not walk the call stack until you come across a method that is not from 
the same namespace as your wrapper?

 

Just an idea…

 

 

From: Andreas HOELZLWIMMER [mailto:andreas.hoelzlwim...@racon.at] 
Sent: 01 June 2012 08:36
To: log4net-user@logging.apache.org
Subject: ILog Wrapping

 

Hi, 

I need to switch our logger to Log4Net in our application. I need to implement 
our personal logging interface, which means I need to wrap the Logger. The 
logger requires to display method name and namespace. With the "usual" way it 
always shows the method and namespace of the wrapper, not the method called. 
The option found on stackoverflow 
(http://stackoverflow.com/questions/157232/how-to-log-methodname-when-wrapping-log4net
 
<http://stackoverflow.com/questions/157232/how-to-log-methodname-when-wrapping-log4net>
 ) does not help and I wanted to know if there is a way to log the correct 
method/namespace without having to go back in the call stack. Is there a best 
practise for wrapping ILog? 

best regards, 

Andreas 


Der Austausch von Nachrichten mit o.a. Absender via e-mail dient ausschließlich 
Informationszwecken. Rechtsgeschäftliche Erklärungen dürfen über dieses Medium 
nicht ausgetauscht werden.

Correspondence with a.m. sender via e-mail is only for information purposes. 
This medium is not to be used for the exchange of legally-binding 
communications.


EnServe Group

Reply via email to