I'm using Rails 5 and I'm sending application logs to papertrail using this snippet on my environments/production.rb
config.logger = ActiveSupport::TaggedLogging.new(
RemoteSyslogLogger.new(
'logs6.papertrailapp.com', 41364,
program: "rails-#{Rails.env}"
)
)
Sometimes there's a delay sending out the logs to papertrail so I do tail -f production.log
manually but it doesn't show anything since the logs were being sent to papertrail.
To view tailed logs I need to replace the config.logger with
config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(File.join(Rails.root, "log", "#{Rails.env}.log")))
Is there a way in Rails I can use multiple logger in the same environment? Basically I want to send logs to papertrail or view logs manually using tailed logs?