Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How To Rotate Your Rails Logs By Size, So You Can Allocate A Certain Amount Of Space For It.

DZone's Guide to

How To Rotate Your Rails Logs By Size, So You Can Allocate A Certain Amount Of Space For It.

·
Free Resource
Add this to RAILS_ROOT/config/environment.rb to keep 50 logfiles of 1MB each.

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

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}