Rails built log functionality, or more precisely, rails exposes the Logger object, which can be used in all rails programs.
Logger is a simple log frame ported from Ruby (you can type RI logger to view the documentation of the standard library in Ruby's command line), and for us, we just need to know that logger can target warnning,info, Error or fatal level to generate log information, and then determine which levels of log information is written to the log file.
Logger.warn ("I don ' t ' idea", "a good idea")
Logger.info ("Dave's trying to doing something bad")
Logger.error ("Now he" gone and broken It)
Logger.fatal ("I Give Up")
In a rails program, log information is written to the log folder file, which file, depending on your current program's environment configuration, if the development environment, then log information will be written to the log\ Development.log file, corresponding to the test environment, log files for the log\test.log,production environment, log files for Log\production.log