Log4r housekeeping

Can I get log4r to change te log filename each day so that it is more
easily housekept?

On Apr 23, 2008, at 3:40 AM, Col W. wrote:

Can I get log4r to change te log filename each day so that it is more
easily housekept?

I do believe log4r has a rolling file appender that will perform date/
size based rolling of your log files. This will not alter the basename
of the log file, just increment a counter …

basename.1.log
basename.2.log
etc.

Changing the basename is something you would have to do
programatically from your own code. I do not think log4r supports that.

Blessings,
TwP

On 23 Apr., 11:36, Col W. [email protected] wrote:

Can I getlog4rto change te log filename each day so that it is more
easily housekept?

Hi Col,
of course you can. Pls use the outputter DateFileOutputter.
Have a look at the files in gems’ example directory:
/install_dir/ruby/lib/ruby/gems/1.8/gems/log4r-1.0.5/examples:
yaml.rb & log4r_yaml.yaml.

You can change the logfile name each year or month or day or hour or
minute …

Cheers

Andreas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs