Our production logs are long and contain a lot more than just errors. I'd like a second log file with just the errors/exceptions in.
Is this possible?
We're using rails 2.x
Thanks.
Our production logs are long and contain a lot more than just errors. I'd like a second log file with just the errors/exceptions in.
Is this possible?
We're using rails 2.x
Thanks.
For example, to log all ActiveRecord::Base errors in a file called log/exceptions.log
For controllers and view(because ActionView logger doesn't have it's own logger, so it depends on the ActionController logger):
Try the following. Put the rescue_from method in your controller.
I haven't tested this. But maybe it puts you in the right direction
If you use Rails 2.1 (also not tested)