log4r housekeeping

C

Col Wilson

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

Tim Pease

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
 
A

ahund

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,204
Messages
2,571,066
Members
47,672
Latest member
svaraho

Latest Threads

Top