You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Shachindra Agarwal <sh...@metallect.com> on 2003/07/30 15:13:46 UTC

Setting multiple log threshold in multi-threaded environment

Hello:

I am a new user of log4j. I am trying to use it in a multi-user,
multi-threaded environment. In this environment, each thread performs
operations on behalf of a unique user. Each user may have different log
threshold levels. For example, we may want to log only FATAL messages = for
user 'joe', whereas we may wish to log ALL messages for user 'pete'.

As per the recommendations, I have created a static logger instance across
all the threads. However, I can now only set a single log threshold level
across all the threads. I realize I can simulate multiple log threshold
levels (one per thread - for each user) by using MDC, but that is expensive.

Am I missing anything? Should I be creating one logger object per thread?

Thanks for your input.

-- Shachin.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org