Ceki,

A number of internal components rely on the fact that the Appender.doAppend() method is synchronized. It is certainly possible to write appenders which do not require synchronization. However, this will require a substantial investment.

There is no simple and safe workaround except rewriting the appenders and layouts you would like to use.


The problem is not writing the appenders. I know that I have to write a special appender for my purposes. The problem seems to be, that all accesses to this appender will be synchronized by the Category if they have a common Category in the hierarchy - what they usually do. The problem is implemented in method Category.callAppenders which synchronizes calls to all parent categories, especially those with appenders.

Please see my reply to my mail.

Do you think it's possible to make the categories more "concurrency friendly"? Otherwise all the efforts on the appender side won't work.

"Concurrency friendly" means: Calls to Category.callApenders should be possible by many threads concurrently (readers) except when one threads wants to call addAppender, removeAppender or something similar (writer). Then all readers should have to wait for the writer's completion - a very short time.

I think a pattern like this is important for large scale concurrent applications that want to use log4j not only to log to console or file but also to databases and archives.

Ingo.







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to