[ENV] Add lograge config
This commit is contained in:
parent
d2094fbbd1
commit
3e23ba5a4f
3 changed files with 4 additions and 0 deletions
|
@ -105,4 +105,6 @@ Rails.application.configure do
|
||||||
protocol: :https,
|
protocol: :https,
|
||||||
host: ENV['APP_HOST']
|
host: ENV['APP_HOST']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.lograge.enabled = ENV['LOGRAGE_ENABLED'] == 'enabled'
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,6 +40,7 @@ class ActiveJobLogSubscriber < ::ActiveJob::Logging::LogSubscriber
|
||||||
tags.push('exception') if data[:exception]
|
tags.push('exception') if data[:exception]
|
||||||
data[:tags] = tags
|
data[:tags] = tags
|
||||||
data[:type] = 'tps'
|
data[:type] = 'tps'
|
||||||
|
data[:source] = ENV['SOURCE']
|
||||||
|
|
||||||
log(data)
|
log(data)
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,7 @@ Rails.application.configure do
|
||||||
config.lograge.custom_options = lambda do |event|
|
config.lograge.custom_options = lambda do |event|
|
||||||
{
|
{
|
||||||
type: 'tps',
|
type: 'tps',
|
||||||
|
source: ENV['SOURCE'],
|
||||||
tags: ['request', event.payload[:exception] ? 'exception' : nil].compact,
|
tags: ['request', event.payload[:exception] ? 'exception' : nil].compact,
|
||||||
user_id: event.payload[:user_id],
|
user_id: event.payload[:user_id],
|
||||||
user_email: event.payload[:user_email],
|
user_email: event.payload[:user_email],
|
||||||
|
|
Loading…
Reference in a new issue