-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging can load initializers first? #21
Comments
Well, My problem is the config/logging.rb is called first then initializers, so config.log_to comes with a default (file), not my declared stdout. I used to not change original config files and create initializers to be easier future upgrades. So, there is some way to call config/initializers/logging.rb first then config/logging.rb or a better workaround? I did a ugly workaround like the following: Rails.application.configure do
if Rails.env.production?
config.log_to = %w[file]
config.show_log_configuration = false
else
config.log_to = %w[stdout]
config.show_log_configuration = true
end
config.log_level = :debug
end
Logging::Rails.configure do |config|
... |
Does using You should really only have to set I am using a simple initializer with |
I set it directly on |
Gemfile:
config/loggin.rb
The original.
config/initializers/logging.rb:
Log configuration:
I tried to let the config on environments files, but the same effect, the Rails original logging was supressed, but I can't log. I tried:
The problem is that log?:
Logging ....................................... *off -A -T
If yes, What I need more to re-enable Rails logging with my manual one?
How is the logging calling?
Rails.logger.xyz
?Thanks you.
The text was updated successfully, but these errors were encountered: