I'll try to flesh out a sandbox project for this at ApacheCON US 's
Hackathon next week. I don't know of any other log4j developers that
will be there, but at least one log4net developer will be attending.
It would be nice if the design could support the existing
functionality of KeyFileAppender, the log file per user/thread/
session pattern and a subset of the o.a.l.rolling.RollingFileAppender
functionality. The rename/delete after close behaviors in the RFA's
add a whole lot of complexity and potential problems and would be
nice to have something that does get some of the RFA's benefits but
avoids the renaming/deleting landmines.
The fundamental characteristics that I see are:
A pluggable strategy to determine the file name from a LoggingEvent.
A map of open writers and last write time keyed by file name.
A configurable limit on the number of writers open at any one time.
A configurable limit on the time a writer will rename open without
any writes.
Opening or reopening a log file will append to the file.
I would expect this to be derived from AppenderSkeleton or maybe
WriterAppender, but not FileAppender.
I like the name MultiFileAppender at the moment.
Headers and Footers might be interesting. I think you'd only write
the header when the file does not exist. I think you would not want
to write the footer when a file was closed due to max open files or
elapsed time, which might mean keeping around a list of file names
that had been encountered and writing the footers when the overall
appender was closed. Or maybe not support headers/footers at al.
I would not suggest using a thread to monitor the elapsed time, but
just check the map of writers on each log request.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]