OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Make grape logging grokable by our logging instrumentation
Christophe Bliard88f9772b23ae
diff --git a/config/initializers/grape_logging.rb b/config/initializers/grape_logging.rbindex 0f2c00c4d33..38d17f1947d 100644--- a/config/initializers/grape_logging.rb+++ b/config/initializers/grape_logging.rb@@ -31,12 +31,17 @@Rails.application.configure doconfig.after_initialize doActiveSupport::Notifications.subscribe("openproject_grape_logger") do |_, _, _, _, payload|- time = payload[:time]+ # Have attributes somewhat in the same order as lograge does with+ # processed controller action to ease later grok parsing.+ # See `Lograge::LogSubscribers::ActionController#initial_data`attributes = {- duration: time[:total],- db: time[:db],- view: time[:view]- }.merge(payload.except(:time))+ method: payload[:method],+ path: payload[:path],+ duration: payload[:time][:total],+ db: payload[:time][:db],+ view: payload[:time][:view],+ **payload.except(:method, :path, :time)+ }extended = OpenProject::Logging.extend_payload!(attributes, {})Rails.logger.info OpenProject::Logging.formatter.call(extended)