Hi all,
 
We are writing a pure Java server that manages some flow threads - Each thread 
reads a packet from the network, parses it and runs the relevant flow according 
to the recognized message...
We are using the log4j as the logging mechanism agent and bumped into a 
blocking problem...
As each thread tries to print log messages over its flow, it sits and waits for 
its turn to append the log event to a file via the appender mechanism 
synchronically...
The problem occurs when we are at a heavy load, a printing thread can sit more 
than 8 seconds and wait for its turn...
Is there a way ,each thread would append the log-event to a non-blocking queue 
and returns immediatedltly after it has put the event in the queue and continue 
its flow?
I know, the log4j has an asynchappender we may use - Is it safe to use? Does it 
serves our purposes?
As we are using only one type of appender, the recommendation in the log4j 
manual, was not to use the asynchappender but only if u have multiple 
appenders...
I will appreciate if someone can reply and suggests an idea to solve this...
Many thanks in advance,
 
Yaron Feigin

Reply via email to