You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Jim Moore <mo...@gmail.com> on 2004/09/01 17:08:19 UTC

Re: Custom Appender

I'm unclear how what you're asking for isn't handled by
RollingFileAppender, but all of the major appenders are pretty easy to
customize.  In your log4j.properties/xml file you'd just specify your
new class instead of the standard one.


----- Original Message -----
From: Onyi <cd...@yahoo.com>
Date: Tue, 31 Aug 2004 10:50:30 -0700 (PDT)
Subject: Custom Appender
To: log4j-dev@logging.apache.org


Hi, 
  
I am trying to see if I can leverage log4js nice feature of being able
to do book keeping of log files and their sizes (e.g
RollingFileAppender).  I have two files which are backed up everytime
a process runs.  I only want to maintain a certain amount of backup
info.  From those with experience would it be worth trying to extend
one of the existing Appenders in log4j to do this, or is a manual
solution (rolling my own check and verify) the better way to go.  I am
already using log4j in this app so it would be nice if I could piggy
back on it for this functionality.
  
-D

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: Custom Appender

Posted by Onyi <cd...@yahoo.com>.
Thanks.  Yes I realized a much simpler solution was just get all the text from my file into a StringBuffer and input one long string into a logger whose appender was a rolling file appender.  Seems to work fine although probably not the most efficient way.  Hopefully there are no message length constraints for loggers.

Jim Moore <mo...@gmail.com> wrote:I'm unclear how what you're asking for isn't handled by
RollingFileAppender, but all of the major appenders are pretty easy to
customize. In your log4j.properties/xml file you'd just specify your
new class instead of the standard one.


----- Original Message -----
From: Onyi 
Date: Tue, 31 Aug 2004 10:50:30 -0700 (PDT)
Subject: Custom Appender
To: log4j-dev@logging.apache.org


Hi, 

I am trying to see if I can leverage log4js nice feature of being able
to do book keeping of log files and their sizes (e.g
RollingFileAppender). I have two files which are backed up everytime
a process runs. I only want to maintain a certain amount of backup
info. From those with experience would it be worth trying to extend
one of the existing Appenders in log4j to do this, or is a manual
solution (rolling my own check and verify) the better way to go. I am
already using log4j in this app so it would be nice if I could piggy
back on it for this functionality.

-D

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org