Hello everyone,

we have recently encountered a problem with log4j, when we run out of disk-space on one of our production servers. It causes slowdowns in the particular web application that we do the logging for. We have actually observed this happen live, and are quite sure that it is caused by log4j.

Now the simple solution would obviously be to clean out old log files regularly, or setup a script to do this, to prevent the server from running out of disk space. Unfortunately we do not have access rights to these production boxes to do this, and there's a very large number of web applications deployed. The system administrators we go through don't have time to setup scripts for cleaning out old log files, or to clean out old log files manually.

Currently I've been looking at several options to work around this:
1.) We could implement an AsyncAppender. However I don't believe that this will solve the slowdown issues, since the log4j documentation mentions that if the buffer fills up, the append() method will block. I'm guessing that this will happen if we run out of DiskSpace, and the attached FileAppender will get into problems. I've however not tried this in practice.
2.) Use a SocketAppender to log all the output to:
a.) a different server.
b.) locally, which should still have the effect of doing the logging asynchronously.
The log4j documentation is somewhat ambiguous when it comes to describing the blocking behaviour of the SocketAppender. According to the documentation, 'if the remote server is down or unreachable, the logging events will simply be dropped.' Further down however it mentions: 'where the network link to the server is down, the client will eventually be blocked.'


What we need is a solution that once we run out of disk-space on the server, will simply drop all logging statements until more disk-space is added without causing any slowdown in the application. Alternatively, we could consider setting up a server simply for logging purposes, however we do not want our web-app to slow down, if we can't reach this logging server for any reason either.

Does anyone have suggestions as to how this can be achieved?

Regards,
  Andreas

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



Reply via email to