At 12:40 AM 6/9/2004, Nicko Cadell wrote:
Another solution is to ignore the main issue.

:-)

A log file using XML format is not appendable. By this I mean that opening
an existing file and appending breaks the file format. Therefore we would
just say that using the FileAppender in append mode with this file format is
not supported. The header is written when the file is opened, the footer
when the file is closed. The file cannot be opened and added to. This may
not be the most useful position, however in conjunction with a rolling
strategy it may work.

Lacking a better solution, documenting this restriction appears to be the most reasonable thing to do, not entirely satisfactory but reasonable.

If you can setup a rolling strategy that rolls the file on startup if it
exists then you have a situation where you never need append to the file.

Good point. In my analysis outlined in my previous message, this case was mentally merged into a "rollover", but you are right it is a slightly different case.

Each time the app starts it rolls the current log file out of the way before
creating a new file. This will impact the rolling strategies you may be able
to select for this file format. You may also end up with a lot of files just
containing the header and footer (one per execution) if you aren't logging
any messages.

It actually can get worse because rollovers can fail. In case of failed rollover, we skip the rollover and continue appending to the existing log file.

It's a really messy problem, indeed.

Nicko

-- Ceki G�lc�

For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp





Reply via email to