----- Original Message -----
From: "Paul Smith" <paul...@lawlex.com.au>
To: "Log4J Users List" <log4...@logging.apache.org>
Sent: Tuesday, March 02, 2004 3:42 PM
Subject: Re: Fw: ThreadLocalAppender for log4j? resending
On Wed, 2004-03-03 at 10:33, Ramakrishna Menon wrote:
Paul
Thanx a lot!
my requirements:
When a url is rendered, the entire rendering logic is done in a separate
thread (assume
one request = one separate thread). In the logic of rendering the url,
we have log4j messages being logged. I want to transparently "trap"
those
messages
so that I can dump them on the url page itself based on a flag that I
specify in the url.
I would assume you mean "distinct" thread as opposed to "seperate"
thread? IE. for a given web request, you are saying only 1 thread
processes it. This is true 99% of the time unless your code calls on
something else that involves other threads and some rendevouzing, but
otherwise 99% of the time yes.
Not sure what the difference between "distinct" and "separate" here is:)..
Anyways
- yes that is waht I was implying about the request - We are assuming that
we fall in the 99% case.
I think what your idea is to create one Appender per thread and then
filter
out the log4j
messages for that thread, correct? That is an interesting one - I will
get
back on how it goes.
Yes, the appender in my example gets initialised with a Filter that only
accepts LoggingEvents from the thread that created it.
Would be great to hear how you went with it.
Will let you know...
Thanx!