Synchronous logging incurs a large performance penalty as it may block. Is there a standalone Ruby library that does asynchronous logging (log4r doesn’t seem to)? Can I modify the standard library logger to log asynchronously? I’m looking for something like log4j’s AsyncAppender – but preferably an implementation that makes use of Ruby’s code blocks to shift as much work to the background thread as possible.
Synchronous logging incurs a large performance penalty as it may block. Is there a
Share
I know you shouldn’t really answer your own question, but it seems everything is easy in ruby:
And for my logging example:
As return values work, you can use this for just about anything: