DEV: Use `Rails.logger` instead of logster for rails_failover callbacks
`Discourse.warn_exception` logs to logger by default but it means we lose all the backtrace when the logs are written to the log file.
This commit is contained in:
parent
b66f2187f1
commit
dc4071dfef
|
@ -30,7 +30,7 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
|||
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
|
||||
end
|
||||
rescue => e
|
||||
Discourse.warn_exception(e, message: "Failed to run failover callback")
|
||||
Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
|
||||
false
|
||||
end
|
||||
|
||||
|
@ -45,7 +45,7 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
|||
ActiveRecord::Base.connection_handlers[ActiveRecord::Base.writing_role]
|
||||
end
|
||||
rescue => e
|
||||
Discourse.warn_exception(e, message: "Failed to run fallback callback")
|
||||
Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
|
||||
false
|
||||
end
|
||||
|
||||
|
@ -76,7 +76,7 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
|||
Discourse::PG_FORCE_READONLY_MODE_KEY
|
||||
)
|
||||
rescue => e
|
||||
Discourse.warn_exception(e, message: "Failed to force AR reading role")
|
||||
Rails.logger.warn "#{e.class} #{e.message}: #{e.backtrace.join("\n")}"
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue