rails rant of the day

Why does Rails choose to, unlike the standard ruby Logger, eliminate inclusion of severity and timestamp in a log line? It makes the logs kind of useless, I don’t get why they thought this was a sensible default?

Why did older versions of Rails do this by actually monkey-patching standard ruby Logger, making it very hard to un-do or change, and effecting everyone using a Logger, not just Rails own?

Why did newer versions of Rails use a custom BufferedLogger, which, while not monkey-patching Logger anymore, also doesn’t sub-class Logger, and while it duck-types the basic functionality of Logger, doesn’t implement the #formatter method to take a Logger::Formatter  — so it’s still way more difficult and confusing than it should be to customize your logging to, for instance, add severity level and timestamp back in?

How hard would it be for me to prepare a patch to Rails that adds support for Logger::Formatter to BufferedLogger, as well as making a config.logger.formatter that works, to make it easy to customize this? (Figuring out Rails test framework is the main barrier to me; how to run the tests, how to add tests, where to add a test for this, etc).  How likely would it be for my patch to be accepted if I did so? (I’ve got no time to write patches that will languish in a tracker for years and never make it into code).

Sometimes the decisions made by Rails team baffle me.

This entry was posted in General. Bookmark the permalink.

One Response to rails rant of the day

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s