> Currently we are considering log4j for our application
> logger and so I have tried out the basic features of log4j ....
> But i have a doubt when i try to log in a multithreaded
> environment...DOES log4j PROVIDE A SYNCHRONIZED LOGGING MECHANISM??
Yes - or rather, it depends on the appender in question, but any
appender inheriting from AppenderSkeleton (which most will) synchronize
there.
> say a thread A is logging some message in a class at
> the same time when another thread of the same class is
> also busy logging!! In such an event my HO is that since
> the Category object that they share is a static one with
> the same name, messages from both the threads would go to
> the same Category object..am i right?
Yes.
> Also, consider a situation wherein my thread A has a big
> message and has called its cat.info(message)...similarly
> thread B had called its cat.info(message) but has only a
> smaller message. In such a case, which will appear first,
> say in my file if i use a FileAppender, message of thread A or B???
Whichever gets to the appender.doAppend() first.
Jon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]