You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Christopher Berry <ch...@etrade.com> on 2001/11/16 22:32:06 UTC

UniqueFileAppender

Greetings,
We needed a FileAppender which could generate unique file names (unique to a
given VM -- but not unique within the VM). I wrote one, the
UniqueFileAppender, which I have attached in hopes that someone on this list
will know how to get it into the log4j pipeline. Or just in case anyone else
would find it useful.
 
UniqueFileAppender extends FileAppender to use unique filenames. The
filename is constructed from the VMID, the host name, and an optional file
prefix. Note that the VMID should be sufficient for uniqueness. The
additional prefixes are meant to aid in file management.
The resulting filenames will be something like the following;
ETTRACE-sirius-37cb61f8f3397d86-6db54-ea35fb6c3f.log

Thanks,
-- Chris

Chris Berry  --- christopher.berry@etrade.com  -- 512-323-9479