timber-ruby
timber-ruby copied to clipboard
How do you test stdout logging in development?
I just wasted a bunch of time because no matter what I did no context was logged to stdout. Turns out there is a MessageOnlyFormatter that is transparently used in development without any initialization message or notice in the docs. Is there a way to disable it in development? If not how can I test that my context is being correctly populated when sending to stdout?
Note: this is where the MessageOnlyFormatter is set: https://github.com/timberio/timber-ruby/blob/6b469a202caf3c3934d3c90109f358610bde9f9e/lib/timber/logger.rb#L176-L177
what worked for me was I set RACK_ENV=production when started the server