Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Log rotation in rails...

Replytotopic

Log rotation in rails

Posted in Forums : Ask a Rails expert

 
Profile

Authority 12
Posting Rating 96
Sign in to rate this post

I am looking for a way to rotate my apps log file daily/weekly

I tried this by specifying

config.logger = Logger.new(”#{RAILS_ROOT}/log/#{ENV[‘RAILS_ENV’]}.log”, ‘daily’)

in my environment.rb file, though this works fine in my development machine but it fails in the production ENV ( a reason could be my app folder is made as read only )

I am using
Windows 2003 server
Rails 1.2.5
Ruby 1.8.6

any suggestions please ….......... :)

 
Ernie

Authority 25
Posting Rating 99
Sign in to rate this post

If the folder your app is logging to is read-only to the user the app is running as, then logs won’t be getting rotated. Of course, using Windows as your Rails production deployment server seems like you’re just asking for trouble to me. ;)

 
Profile

Authority 12
Posting Rating 96
Sign in to rate this post

Thanks Ernie …..........

Any workaround for this

 
Ernie

Authority 25
Posting Rating 99
Sign in to rate this post

If you aren’t the admin to the server, do you have authority to request that the admin ensure proper write permissions to the directory in question are granted? That’s really the solution.

Replytotopic

Other Recent Topics

Ask a Rails expert : how to check processs is running or stop

Ask a Rails expert : Routing problem using patterns for id

Ask a Rails expert : How to work with ror 2.1.1 using Netbeans IDE 6.1

Ask a Rails expert : json gem error

Ask a Rails expert : Problem with break

Ask a Rails expert : activesupport string first method error

Ask a Rails expert : url_for broken ?

Ask a Rails expert : map.routes.rb pls help

Ask a Rails expert : how to h tag in controller

Ask a Rails expert : Problem with Restful routing and partial form

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel