Parallel log4j

I have my own logging mechanism that writes logs to a separate thread with a blocking queue. For the sake of using "standard software," I am thinking of switching to log4j.

I don’t want my very parallel software to be slowed down by using the log commands that write everything to disk, like some that are called by the command. Can log4j be used instead of a basket?

+7
source share
2 answers

Log4j is a logging implementation on most JavaEE server applications, so a good announcement for concurrency features.

Having said that, I saw the Log4j 1.2 deadlock under high load conditions. A little bit about the investigation revealed incorrect synchronization of the source code. Apparently, this was recorded in Log4j 1.3, although development on this slowed down or stopped altogether - I feel that most of the source was not worthy.

However, if you are free to choose, then you should consider Logback , the spiritual successor to Log4j. This is a reorganization on earth, and probably this is the best option for you.

+6
source

Check the log4j asynchronous appender , it buffers the log messages that send them to applications using a separate thread. Perhaps you have decided that the log4j async application is not suitable (here are some complaints about it) , you can always make your own appender.

+3
source

All Articles