I'm trying to figure out how to use the logger with rails 3. I need to log to a file not have it in the console, but I just can't figure out how to set it up and then, how to write something to that log. I tried the rails docs but they didn't really make it clear.
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- I want to trace logs using a Macro multi parameter
- How to specify memcache server to Rack::Session::M
相关文章
- how do I log requests and responses for debugging
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
By default, Rails should be logging to an environment-specific log file in your project's
log
directory. It will be called eithertest.log
,development.log
, orproduction.log
depending on which environment you're running in.You can log directly to Rails' logger using the
Rails.logger
object:Rails used to use Ruby's standard logging class, but it now uses
ActiveSupport::BufferedLogger
. (The official Ruby on Rails Guides are incorrect when they say "Rails makes use of Ruby’s standard logger to write log information").