Is there some guide about logging in Rails? There doesn't seem to be an official guide about that topic. Does Rails have an own logging API, or does it internally use the Ruby logging system?
I am using Rails 3.
Rails makes use of the ActiveSupport::Logger class to write log information. Other loggers, such as Log4r , may also be substituted. By default, each log is created under Rails. root/log/ and the log file is named after the environment in which the application is running.
In a Rails app, logs are stored under the /log folder. In development mode, the development. log file is used & you see log output on the terminal you're running rails server on.
Rails uses six different log levels: debug, info, warn, error, fatal, and unknown. Each level defines how much information your application will log: Debug: diagnostic information for developers and system administrators, including database calls or inspecting object attributes. This is the most verbose log level.
Per the docs, Rails uses the standard Ruby logger, you can work in log4r (or other) if you'd like: http://guides.rubyonrails.org/debugging_rails_applications.html#the-logger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With