reidmorrison / rails_semantic_logger

Rails Semantic Logger replaces the Rails default logger with Semantic Logger
https://logger.rocketjob.io/rails
Apache License 2.0
321 stars 115 forks source link

ensure log_to_stdout is patched for startup #114

Closed misaka closed 3 years ago

misaka commented 3 years ago

Issue # (if available)

113

Description of changes

In rocketjob/rails_semantic_logger#106 the order of requiring semantic logger extensions is changed as part of the change to add support of the "disabled" attribute. This appears to have the side-effect of not patching "log_to_stdout", in rails_semantic_logger/extensions/rails/server.rb, early enough to enable logging to STDOUT by default.

This commit reverts that one change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

misaka commented 3 years ago

By the way, I tried to find a way to test this, but couldn't think of a sensible way short of starting up rails server and somehow testing what logs are output to STDOUT. If anyone can recommend a way to test this I'd be happy to add it.

reidmorrison commented 3 years ago

Thank you for the PR. Decided to revert the entire previous pull request that introduced the problem.