Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Logging Best Practices in Ruby

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.

like image 517
Joseph Weissman Avatar asked Feb 14 '26 12:02

Joseph Weissman


2 Answers

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.

like image 174
thenengah Avatar answered Feb 16 '26 00:02

thenengah


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

like image 31
karl li Avatar answered Feb 16 '26 00:02

karl li



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!