-
-
Save ilyadoroshin/95553643a3b1529f349651fa5f07d1be to your computer and use it in GitHub Desktop.
Rails Log Cleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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