What are best practices for managing custom logging in Ruby? Should I be monkeypatching logger to do what I want? Or extending from it? Or delegating? What's the rubyish way? I'm sick of custom hacks for this; I'd like something cleaner, and ideally more elegant.
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- I want to trace logs using a Macro multi parameter
- How to specify memcache server to Rack::Session::M
相关文章
- how do I log requests and responses for debugging
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
According to my experience, log4r is no more popular (and I don't know why these days I can't access log4r's homepage). Instead logging is far more better.
FYR
https://www.ruby-toolbox.com/categories/logging
Bates has a screencast on customizing logger.
And here is a blog post on custom logging in Rails.
Here are some tips on logging in Rails.
There's a Ruby implementation of Slf4j, the popular Java logging framework, imaginatively called Slf4r. This separates the actual logging method from the code, and provides a standard interface for logging different message levels.