Skip to content

Instantly share code, notes, and snippets.

@severin
Created April 27, 2011 13:57
Show Gist options
  • Save severin/944286 to your computer and use it in GitHub Desktop.
Save severin/944286 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