Try the following code

Logger logger = .......... //Your logger

Enumeration e = logger.getAllAppenders();
Appender app = null;
while(e.hasMoreElements())
{
     app = (Appender) e.nextElement();
     if(app instanceof RollingFileAppender)
     {

     //Do your roll over here
     }
}



Regards

Vinodh


Preetham Kajekar <[EMAIL PROTECTED]> wrote:
Hi,
Is there a way I can get all the appenders for all the loggers I have
in my system.

My goal is to roll-over the provious log files every time my program
starts up. So I would have code like in an init() function which would
get all appenders, and then call the roll-over method for all the
appeders.

Thanks,
~preetham


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


---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Reply via email to