Closed msdundar closed 5 years ago
Seems problem occurs for any log_level..
As you can see here: https://github.com/shadabahmed/logstasher/blob/master/lib/logstasher/railtie.rb#L7
Logstasher initialized as instance of ActiveSupport::OrderedOptions
:
config.logstasher = ActiveSupport::OrderedOptions.new
But in new rails it also inherit an ActiveSupport
default logger, which sending output to stdout.
And after that.. we moving to setup
method.. where we have already defined logger:
self.logger = app.config.logstasher.logger || new_logger(self.logger_path)
And now at any call of logger
output sends to default ActiveSupport::OrderedOptions
logger..
This can be monkeypatched as follow:
# add this info your development.rb or other environment file
config.to_prepare do
LogStasher.logger = Logger.new("#{Rails.root}/log/logstash_#{Rails.env}.log")
end
+1 for this issue -- even with the monkey patch, I can't get my development Rails.logger.info
to display anything in the logstash log.
Same here... Even with the ninja Monkey Patch, no logger calls is logged
You might want to check #108 . There is still one open topic but for me it's minor and should be fixed in another subsequent PR. Comments welcome.
Other then this I'd say get it merged soon as this is really a pain.
Hi,
I'm running a rails 4 application in development mode.
Here is my
config/environments/development.rb
=>The problem is, when an application error occurs (like 404 not found) I can see the error in
log/development.log
but not inlog/logstasher.log
How can I solve this issue?