Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Logging API

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.

like image 502
tok Avatar asked Dec 07 '10 14:12

tok


People also ask

How do I create a log in rails?

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.

Where are rails logs stored?

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.

What are rails logs?

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.


1 Answers

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

like image 102
Cory Avatar answered Oct 15 '22 08:10

Cory