tasks/request_log_analyzer.rake in request-log-analyzer-1.2.0 vs tasks/request_log_analyzer.rake in request-log-analyzer-1.2.1
- old
+ new
@@ -1,10 +1,26 @@
-namespace :log do
- desc "Analyze the Rails log file using the request-log-analyzer gem."
- task :analyze => :environment do
+namespace :rla do
+ desc "Analyze the Rails log file using the request-log-analyzer gem."
+ task :report => :environment do
+ puts "Analyzing the Rails log file using the request-log-analyzer gem."
+ puts " Environment: #{RAILS_ENV}"
+ puts " Logfile: #{Rails.configuration.log_path}"
+ puts ""
+ IO.popen("request-log-analyzer #{Rails.configuration.log_path}") { |io| $stdout << io.read }
+
+ end
+
+ namespace :report do
+ desc "Analyze the Rails log file using the request-log-analyzer gem and output an HTML file."
+ task :html => :environment do
+ output_file = Rails.configuration.log_path + ".html"
+
puts "Analyzing the Rails log file using the request-log-analyzer gem."
- puts "Environment: #{RAILS_ENV}"
- puts "Logfile: #{Rails.configuration.log_path}"
+ puts " Environment: #{RAILS_ENV}"
+ puts " Logfile: #{Rails.configuration.log_path}"
+ puts " Output: #{output_file}"
puts ""
- `request-log-analyzer #{Rails.configuration.log_path} -z`
+ IO.popen("request-log-analyzer #{Rails.configuration.log_path} --output HTML --file #{output_file}") { |io| $stdout << io.read }
+ end
end
-end
\ No newline at end of file
+
+end