Allow for replacing padrino's logger with our own #2118

cburgmer opened this Issue Jan 20, 2017 · 1 comment


None yet
2 participants

We want to modify the padrino logging output. The only viable way we found was to replace the default logger with our own instance:

logger ='log/production.log')
logger.formatter = proc do |s, d, p, m|
Padrino.logger = logger

However, we are logging objects, not just strings. Just that they never arrive intact when the formatter is called. They just magically get turned into strings again. Turns out this line is responsible for that:

Why are we even triggering this code, if we have replaced the default logger? Turns out this line is doing this:

Our current work around:

# Monkey patch the Logger to ignore the monkey patching on padrino's side
class Logger
  def extend(*args)
  def devel(*args)
  def exception(boom, *args)

Long story short: Please allow us to side-step this behaviour of Padrino, or at least allow us to log our arbitrary logging format. Human readable format is not cutting it for us, we want machines to understand.

@ujifgc ujifgc added the enhancement label Jan 20, 2017

@ujifgc ujifgc closed this in 8440eac Mar 21, 2017


This comment has been minimized.

Show comment
Hide comment

ujifgc Mar 21, 2017


Thank you for your report, fixed in 8440eac


ujifgc commented Mar 21, 2017

Thank you for your report, fixed in 8440eac

adam12 added a commit to adam12/padrino-framework that referenced this issue Jun 5, 2017

allow Logger without Extensions, fixes #2118
WARNING: this changes behavior of `Padrino.logger = new_logger` and adds a deprecation warning about this advanced use.

This does not change the default behavior of Padrino::Logger.setup!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment