Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:08:13+00:00 2026-05-31T15:08:13+00:00

For a Rails 3.1 (will be 3.2 very soon), I have exceptionally verbose logs

  • 0

For a Rails 3.1 (will be 3.2 very soon), I have exceptionally verbose logs that have a lot of additional worker information spewing forth into them.

I routinely end up with multigigabyte development.log files. I’ve seen some various chatter around about rotating production logs, however I’ve not found anything that seems applicable to development.log rotation.

How do you rotate your development.log at every 100.megabytes or so? OR WHAT I WOULD PREFER is to actually truncate the head of the file so that only the most recent items remain in the log, up to 100MB of the most recent entries.

I have played with this a little and am thinking more and more than nothing quite like this exists at present and that perhaps I should implement something that will use the ruby File.truncate somehow, however I’m not sure of the efficacy of this yet on the tail end of the file as of yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:08:14+00:00Added an answer on May 31, 2026 at 3:08 pm

    You can actually tell the Ruby Logger class to rotate the files in the constructor:

    http://corelib.rubyonrails.org/classes/Logger.html#M000163

    Example:

    Logger.new(name, shift_age = 7, shift_size = 1048576)
    

    In one of my enrivornment files I have the following line:

    config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 10, 1048576)
    

    This keeps the last 10 logfiles which are rotated every 1 MB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple web service using Rack, without Rails that I will
I'm planning on creating an app (Rails) that will have a very large collection
I'm working on a Rails app that will contain information on a bunch of
We will soon be rewriting a 5 year old rails app, with a very
I am developing 2 applications in Rails 3.1 (will upgrade soon), and have noticed
So when you use scaffolding Rails will kick out some layouts that are xhtml
I'm defining my own AR class in Rails that will include dynamically created instance
Looking for a Rails validation that will only allow letters, numbers, and spaces. This
I am developing a web app (using rails) that I will be launching within
We are designing an application that will use Rails and Wordpress to interact with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.