Ceki Gülcü wrote:
>>While I was developing the before mentioned appenders, gzip compression >>used to take about 85 seconds to compress a 200mb file. If you have a >>minute-based rolling appender and collect about those 200mb in one minute, >>then strange things could happen (log4j does output buffering, obviously, >>but while the compression takes place, no logs are visible etc etc...) > > The fact that logging will be blocked while compressing large files is a > very valid point. My suggestion would be to use the log4j scheduler to > take care of the compression. I'm not familiar with log4j schedulers; I'll take a look. > Alternatively, one could launch a separate > thread to handle the compression. > >>Anyway, threaded deflater solved the buffering problem, but revealed >>OutOfMemoryError one: while one file is being compressed, another thread >>is just about to start, which eventually could lead to OOME. Some thread >>pool might be a good choice, with parameters such as max concurrent >>compress threads or maybe max size for parallel compression (in >>megabytes). > > Why is there a need for more than 1 compression thread? I don't follow > you. > There's no need for more than one compression thread, but if you have a separate thread to handle compression, and if the rolling procedure happens before the compression thread working on the previous file is still running, then two (and later possibly more) compression threads would be running at the same time, which would cause OutOfMemoryError. So, the basic idea would be to have one Compressor thread with internal files-to-be-compressed queue, and not a Compressor thread per rolled file. >>P.S. Some not-so-obvious libraries are needed to successfully compile the >>newest CVS HEAD code. Are they available from one place or maybe I need to >>hunt them somewhere in the net jungle? > > As long as you use Ant to compile log4j, it is easy. Our Ant build script > will skip the compilation of components with missing dependencies. I see, thanks. > The > problem arises when the user tries to compile with an IDE such as Eclipse. > This is an important concern requiring further investigation. Yes, I'm using Eclipse and it complains about missing libraries. -- Davor Cengija, [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
