Use parentheses
This commit is contained in:
parent
94bd62f9a2
commit
7ffe40868b
2 changed files with 4 additions and 4 deletions
|
@ -32,9 +32,9 @@ class ActiveJobLogSubscriber < ::ActiveJob::Logging::LogSubscriber
|
||||||
|
|
||||||
def process_event(event, type)
|
def process_event(event, type)
|
||||||
data = extract_metadata(event)
|
data = extract_metadata(event)
|
||||||
data.merge! extract_exception(event)
|
data.merge!(extract_exception(event))
|
||||||
data.merge! extract_scheduled_at(event) if type == 'enqueue_at'
|
data.merge!(extract_scheduled_at(event)) if type == 'enqueue_at'
|
||||||
data.merge! extract_duration(event) if type == 'perform'
|
data.merge!(extract_duration(event)) if type == 'perform'
|
||||||
|
|
||||||
tags = ['job', type]
|
tags = ['job', type]
|
||||||
tags.push('exception') if data[:exception]
|
tags.push('exception') if data[:exception]
|
||||||
|
|
|
@ -30,7 +30,7 @@ Rails.application.configure do
|
||||||
end
|
end
|
||||||
|
|
||||||
config.lograge.keep_original_rails_log = true
|
config.lograge.keep_original_rails_log = true
|
||||||
config.lograge.logger = ActiveSupport::Logger.new Rails.root.join('log', "logstash_#{Rails.env}.log")
|
config.lograge.logger = ActiveSupport::Logger.new(Rails.root.join('log', "logstash_#{Rails.env}.log"))
|
||||||
|
|
||||||
if config.lograge.enabled
|
if config.lograge.enabled
|
||||||
ActiveJobLogSubscriber.attach_to(:active_job)
|
ActiveJobLogSubscriber.attach_to(:active_job)
|
||||||
|
|
Loading…
Reference in a new issue