timber-ruby icon indicating copy to clipboard operation
timber-ruby copied to clipboard

How do you test stdout logging in development?

Open axelson opened this issue 5 years ago • 2 comments

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?

axelson avatar Jul 05 '19 21:07 axelson

Note: this is where the MessageOnlyFormatter is set: https://github.com/timberio/timber-ruby/blob/6b469a202caf3c3934d3c90109f358610bde9f9e/lib/timber/logger.rb#L176-L177

axelson avatar Aug 29 '19 02:08 axelson

what worked for me was I set RACK_ENV=production when started the server

kodujeme avatar Sep 11 '19 09:09 kodujeme