Hi all,
I'm building some kind of server and I use log4j for logging.
For troubleshooting issue I whant to be able to debug some few requests
only (based on matching criterias) so that it is possible to debug live
servers without killing performances.
I managed to use NDC and filters to do that a
I'm not sure your proposal solves my problem.
I'm sorry if my question was not clear enough. Let me try another way:
Considering the following code snippet
// the following method is called-back hundred of time
// per second.
public void process(Request request, Response response)
{
NDC.push(
This is the kind of answer I was afraid of ;)
But that is a very powerfull feature some of our (large) customers are asking
for very loudly: it gives both debug messages and good-enough performance for
live systems.
Sure I could do it myself, but then that would not apply to already existing
l
I believe this is not necessary. Using a NDC and a Filter impl (the
log4j_sandbox NDCMatchFilter e.g.) would do the same if I'm correct.
But still it does not prevent the application (that is the buildDebugMessage()
call) from building the debug message, which is quite CPU intensive.
>-Origi
That's an interresting work arround.
Still that is tedious when several criterias are needed.
Since we are talking about a server, that would create a huge number of
loggers. Do you have any idea about performance impact?
>-Original Message-
>From: ext James Stauffer [mailto:[EMAIL PROTE
After an extra look at log4j source I wonder if I've found some kind of
solution:
Logger contains the following signature:
log.debug(Object message)
Here this is an "Ojbject" and not a "String".
If I create some class in charge of building the debug message only when its
toString() method is c
I tried and this solution works like a charm!
Log4j designers are really clever guys :)
>-Original Message-
>From: ext
>[EMAIL PROTECTED]
>ache.org
>[mailto:[EMAIL PROTECTED]
>gging.apache.org]
>Sent: Wednesday, July 19, 2006 6:26 PM
>To: log4j-user@logging.apache.org
>Subject: RE: High
Sure, that is just another workaround.
>-Original Message-
>From: ext Bender Heri [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 19, 2006 7:17 PM
>To: Log4J Users List
>Subject: RE: High performance filters
>
>Very nice, indeed, but it doesn't apply to existing logging
>code neither...
I believe that a DailyRollingFileAppender that would roll-over upon file
size would simply not be a DailyRollingFileAppender any longer.
I mean, roll-over would no longer append in a schedulded way, and that
is what DailyRollingFileAppender is meant for...
>-Original Message-
>From: ext Ja