> Ceki Gülcü wrote:
>>
>> Hi Mike,
>>
>> We all make mistakes there is no shame in that. I wouldn't worry about it.
>>
>> Thank you for your offer for help. Bug #1960 might be suitable. Have a look
>> at
>>
>> http://nagoya.betaversion.org/bugzilla/show_bug.cgi?id=1960
>>
>> Regards, Ceki
>>
>
> 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.
>
> 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.
>
> 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...
>
> 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.
>
> /mike
>
I'm sorry to put that on the table, maybe it already has been discussed
lengthy, but I don't see what is fundamentally wrong with having multiple
headers in a single file ?
I once had a CSV data file (each lines is a record, the fields in a record
are separated by commas) where each records could have a different format
than the previous one provided that you insert a header defining the new
format. There was multiple headers in this CSV file, each one defining a new
section and its format: this was not a bug but a welcomed feature.
I know log file are not CSV data file, but you could still analyze a log
file, thus header could provide meaningful information even in the plain
middle of a log file. What if my header provides me with a program version
number, and the program version changed between two sessions, I want to see
a new header with the new program version number at the point where the log
restart, don't you?
IMHO if one requires to have one single header per file then one make sure
the Appender open/use a different file each time it is intanciated (could be
some kind of DailyRollingFileAppender, could be named
SessionRollingFileAppender).
ZartC
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]