Skip to content

Instantly share code, notes, and snippets.

@eddanger
Forked from severin/clean-rails-logs
Created August 23, 2011 17:14
Show Gist options
  • Save eddanger/1165893 to your computer and use it in GitHub Desktop.
Save eddanger/1165893 to your computer and use it in GitHub Desktop.
Rails Log Cleaner
#!/usr/bin/env ruby
logfiles = Dir["#{ENV['HOME']}/**/app/../log/*.log"] # any file with a .log extension in a log directory besides an app directory...
logfiles.each {|file| system "echo '' > #{file}"}
puts "Cleaned #{logfiles.size} logs..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment