Hi, In my controller I have given: logger = Logger.new('try.log', shift_age='daily') A file is created in the root folder of my application as try.log. But if I give logger.info('testing') then this is logged in development.log instead of try.log. Am I missing some setup?
on 2007-03-08 22:31
on 2007-03-09 02:34
If you want a controller specific logger, you should over-write the the inherited @logger attribute and provide an accessor for it. attr_accessor :logger def initialize super @logger = Logger.new('try.log') end ... If you want a rails-wide logger over-ride, you'll need to do it in config/environment* One caveat -- in clustered setups using Ruby-specific log rotation is a huge no-no and will cause you massive headaches in the future. You should rely on some sort of external log rotation solution (logrotate, etc) for those.
on 2007-03-09 03:19
Can you point me as to where I can get an idea of external log rotation?