At 14:20 05.06.2001 -0700, Mike Dougherty wrote:

>I know I keep saying this, and it's probably getting redundant,
>redundant. I'm new here so I don't know if this is an appropriate
>question.

Hi Mike,

It's a question about solving a log4j bug. This qualifies as appropriate to me as 
subject of discussion in the log4j-dev list.   

>I have looked at the code for this bug and the quick fix is to do just
>what he suggests. Check to see if the file is zero length before
>inserting the header. However, I am a little nervous about solving it
>this way because it leaves the superclass (WriterAppender) with the same
>type of problem. Ideally (at least I think) the WriterAppender shouldn't
>write a header if one exists. The trouble is I can't think of a case
>when I WriterAppender (or subclass thereof) will have existing entries
>outside the context of a File. Without making this case I will have a
>difficult time justifying the time to implement the solution needed for
>this object.

Yes, WriterAppender suffers from the same problem. I don't see a robust solution for 
WriterAppender. Joel's  zero-length check seems solid enough for FileAppender.

>One sure way to solve either case is just to always insert the header at
>the zeroth index with an offset of getHeader().length(). The problem
>with this approach is that you run the risk of the header changing
>length. Longer and you overwrite log entries, shorter and you leave
>previous header garbage...

Doesn't compute.

>I am a little nervous to just go ahead and commit to one method or the
>other because I am not that familiar the development styles of this
>project and which solution they would prefer. Any help to point me in
>one direction or the other would be appreciated.

I am looking forward to your patch. I'll commit it when you submit it. Regards, Ceki


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

Reply via email to