Can I enter two different locations in Ruby on Rails 3?

For the Ruby on Rails project, I use the cloud-based logger, Loggly, but I also need to have physical logs on the server, somewhere I can tail or watch if something goes wrong higher on the stack (before the entry in Loggly will be initialized I assume that the site is clearly down right now, but shows nothing about it). Is it possible for the Rails log to be logged in both Loggly and files in a standard way and have identical content recorded for both?

+4
source share
1 answer

I would use log4r. An application is registered only once, but, depending on your log4r configuration, it can send the same log to several logs in several formats using several protocols. This is a steep learning curve (a la syslog), but worth the effort.

+1
source

Source: https://habr.com/ru/post/1396513/


All Articles