The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rotating the Rails logs with FastCGI

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Guy Naor

Posts: 104
Nickname: familyguy
Registered: Mar, 2006

Guy Naor is one of the founders of famundo.com and a long time developer
Rotating the Rails logs with FastCGI Posted: Jun 23, 2006 1:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Guy Naor.
Original Post: Rotating the Rails logs with FastCGI
Feed Title: Famundo - The Dev Blog
Feed URL: http://devblog.famundo.com/xml/rss/feed.xml
Feed Description: A blog describing the development and related technologies involved in creating famundo.com - a family management sytem written using Ruby On Rails and postgres
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Guy Naor
Latest Posts From Famundo - The Dev Blog

Advertisement

Deploying a rails app will eventually lead to the need to manage the rails log files. They get pretty big fast, and if the log level also include the SQL queries, they grow EXTREMLY fast.

Though there is some information about it in the Rails Wiki, it's missing restarting the FastCGI processes. If you are using dynamicaly launched FastCGI processes from lighty or apache, the web server log rotation will restart the FastCGI processes and you will be covered. But if you are using FastCGI processes you launch (using spinner/spawner or a similar solution) the log file will be rotated, but the newly created log file won't be used by the ruby app until it is restarted.

Here is my logrotate configuration:

# Assume the the rails app is installed to /app/my_blog/current
# And that the user we running the app with is called rails
/app/my_blog/current/log/*.log {
  daily
  missingok
  rotate 7
  compress
  delaycompress
  notifempty
  create 0660 rails rails
  postrotate
     /app/my_blog/current/script/process/reaper -a graceful -d /app/my_blog/current/public/dispatch.fcgi 1>/dev/null 2>&1 || true
  endscript
}

The main change from the rails wiki version is the postrotate call that causes the fastCGI processes to restart and reopen the log file.

Read: Rotating the Rails logs with FastCGI

Topic: The Argon Express Has Arrived! Previous Topic   Next Topic Topic: Beating Oprah Winfrey in her own town

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use