How to configure Log4r with Rails 3.0.x?

后端 未结 3 1531
星月不相逢
星月不相逢 2020-12-01 11:15

I tried configuring log4r with Rails 3.0.4 based on this article: http://www.dansketcher.com/2007/06/16/integrating-log4r-and-ruby-on-rails/

/Users/toto/.rvm         


        
3条回答
  •  醉梦人生
    2020-12-01 11:55

    Can anyone point me to a working code snippet that will allow log configuration using a YAML file, and initialization at runtime?

    I wrote a detailed blogpost about how to set up log4r in a way that it replaces the standard rails logger. Furthermore I went into detail about how to use multiple loggers, use log levels as well as how to log Mongoid, ActiveRecord and Exceptions(incluing Stack traces) using Log4r.

    Another apparently more mature gem called "Logging" was suggested in comments on the HackerNews thread corresponding to the article, so people interested in Log4r might want to check on this gem as well.

提交回复
热议问题