RE: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Mohan.Radhakrishnan

Hope to revive this thread. Is there any way to use the feature I have
described.

1. Use the logger hierarchy like Heri had suggested.
2. Use a separate logger file for each logger in the hierarchy.

Thanks,
Mohan
-- 
View this message in context: 
http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p29960730.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Corey Scott

 Hi there,

Is there some param i can set in the log4j.xml to have the 
TimeBasedRollingPolicy delete old files after x days?

Im sorry if this is handled in the doco and Im too stupid to find it :)

Cheers,
Corey

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Ledger, John St W
Corey,

I couldn't find a way to do that either. I made some changes to the 
DailyRollingFileAppender class to meet my needs. See the attachment.

This class creates a new log file each day. The log file is in the user 
directory. Yesterday's log file is renamed, and then 6 total log files are 
retained. The maxBackupIndex field controls how many log files are retained.

Hope this is useful,

John



From: Corey Scott corey.sc...@gmail.com
Reply-To: Log4J Users List log4j-user@logging.apache.org
Date: Thu, 14 Oct 2010 04:50:55 -0600
To: log4j-user@logging.apache.org
Subject: RollingFileAppender + TimeBasedRollingPolicy

  Hi there,

Is there some param i can set in the log4j.xml to have the
TimeBasedRollingPolicy delete old files after x days?
Im sorry if this is handled in the doco and Im too stupid to find it :)

Cheers,
Corey

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org




-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Jacob Kjome
I think for what you want (separate file/logger), you'll need to write a custom
appender unless Bender Heri's suggestion suffices for you.

Jake

On 10/14/2010 3:30 AM, Mohan.Radhakrishnan wrote:
 
 Hope to revive this thread. Is there any way to use the feature I have
 described.
 
 1. Use the logger hierarchy like Heri had suggested.
 2. Use a separate logger file for each logger in the hierarchy.
 
 Thanks,
 Mohan

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Jacob Kjome
Not that I can see.  I think a FixedWindowRollingPolicy +
SizeBasedTriggeringPolicy would do what you need.  Of course, it won't roll 
based
on time, but on size.  Basically, you'd get a maximum backup of 12 (or less
depending on what you configure) archived log files, which is hardly different
than deleting old files.

That said, you might be able to [ab]use a FilterBasedTriggeringPolicy to trigger
rolling based on time (and/or size).

Note that I have not tested this myself.  It would be interesting to learn of 
your
results.

Jake

On 10/14/2010 4:50 AM, Corey Scott wrote:
  Hi there,
 
 Is there some param i can set in the log4j.xml to have the
 TimeBasedRollingPolicy delete old files after x days?
 Im sorry if this is handled in the doco and Im too stupid to find it :)
 
 Cheers,
 Corey
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 
 

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Simon Park
The TimeAndSizeRollingAppenderat www.simonsite.org.uk might do the trick by 
configuration.  You can configure a time-based rolling schedule via a date 
pattern.  There's also a scavenger built-in that will delete older backup log 
files beyond a particular count.  So if you configure the appender to roll 
daily, and set the max backup count to the number of days you're interested in, 
the scavenger will delete the files you no longer want.  The scavenger runs in 
a 
daemon thread so you don't have backup log files being maintained at the point 
of rollover of the current log file.

HTH,

Simon





From: Jacob Kjome h...@visi.com
To: Log4J Users List log4j-user@logging.apache.org
Sent: Thu, 14 October, 2010 16:38:31
Subject: Re: RollingFileAppender + TimeBasedRollingPolicy

Not that I can see.  I think a FixedWindowRollingPolicy +
SizeBasedTriggeringPolicy would do what you need.  Of course, it won't roll 
based
on time, but on size.  Basically, you'd get a maximum backup of 12 (or less
depending on what you configure) archived log files, which is hardly different
than deleting old files.

That said, you might be able to [ab]use a FilterBasedTriggeringPolicy to trigger
rolling based on time (and/or size).

Note that I have not tested this myself.  It would be interesting to learn of 
your
results.

Jake

On 10/14/2010 4:50 AM, Corey Scott wrote:
  Hi there,
 
 Is there some param i can set in the log4j.xml to have the
 TimeBasedRollingPolicy delete old files after x days?
 Im sorry if this is handled in the doco and Im too stupid to find it :)
 
 Cheers,
 Corey
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 
 

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org


  

Re: RollingFileAppender + TimeBasedRollingPolicy

2010-10-14 Thread Corey Scott

 Thank you all for your helpful replies

-Corey

On 15/10/2010 02:41, Simon Park wrote:

The TimeAndSizeRollingAppenderat www.simonsite.org.uk might do the trick by
configuration.  You can configure a time-based rolling schedule via a date
pattern.  There's also a scavenger built-in that will delete older backup log
files beyond a particular count.  So if you configure the appender to roll
daily, and set the max backup count to the number of days you're interested in,
the scavenger will delete the files you no longer want.  The scavenger runs in a
daemon thread so you don't have backup log files being maintained at the point
of rollover of the current log file.

HTH,

Simon





From: Jacob Kjomeh...@visi.com
To: Log4J Users Listlog4j-user@logging.apache.org
Sent: Thu, 14 October, 2010 16:38:31
Subject: Re: RollingFileAppender + TimeBasedRollingPolicy

Not that I can see.  I think a FixedWindowRollingPolicy +
SizeBasedTriggeringPolicy would do what you need.  Of course, it won't roll
based
on time, but on size.  Basically, you'd get a maximum backup of 12 (or less
depending on what you configure) archived log files, which is hardly different
than deleting old files.

That said, you might be able to [ab]use a FilterBasedTriggeringPolicy to trigger
rolling based on time (and/or size).

Note that I have not tested this myself.  It would be interesting to learn of
your
results.

Jake

On 10/14/2010 4:50 AM, Corey Scott wrote:

  Hi there,

Is there some param i can set in the log4j.xml to have the
TimeBasedRollingPolicy delete old files after x days?
Im sorry if this is handled in the doco and Im too stupid to find it :)

Cheers,
Corey

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org





-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org



Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Mohan.Radhakrishnan

Ok. Will try. I think you mean that in order to associate a file name with
each logger in the hierarchy instead of the appender I need to write a
custom appender. 

Am I on the right track then ?
-- 
View this message in context: 
http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p29968873.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org