|
Loading...
|
log4net-user@logging.apache.org
[Prev] Thread [Next] | [Prev] Date [Next]
Re: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... Ron Grabowski Thu Jan 18 18:02:48 2007
I believe the pattern is called "abstract factory".
Your facade needs to perform logging using the methods on ILogger and passing
in the Type of your wrapper class. See this class for an implementation and
comments as to why its necessary:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Logging.Log4Net/Log4NetLogger.cs?revision=293509&view=markup
IBatisNet (ibatis.apache.org), Sooda (www.sooda.org), and The Castle Project
(www.castleproject.org) have abstracted logging libraries (to allow the user to
switch between log4net, NLog, and some simple builtin loggers like a
ConsoleLogger) that do similiar things. I recall there being similiar code on
gotdotnet.com sonewhere too.
----- Original Message ----
From: José Joye <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Thursday, January 18, 2007 1:54:06 PM
Subject: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for
file, methods....
Hello,
We are trying the Log4Net in our projects. However, for different reasons, we
want to expose it to our developers through a Tracing/Error class facade.
Doing so, we face the following problem:
Whenever an Appender print information about LocationInfo (File, line,
Method,....). It will take information related to the caller of the Log4Net
method (which is the facade in our case).
Is there any way to tell Log4Net not to walk more more level on the
stackTrace so as to retrieve the information?
Thanks a lot!
- Jose
- Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... José Joye 2007/01/18
- Re: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... Ron Grabowski 2007/01/18 <=
- Re: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... José Joye 2007/01/19
- What is the best way to attach an ID with each logged message? José Joye 2007/01/22
- RE: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... Budamala, Jayakumar [CCC-OT_IT] 2007/01/19
- Re: Wrapping Log4Net in a Facade --> incorrect LocationInfo shown for file, methods.... Ron Grabowski 2007/01/19