lib/logjoy/log_subscribers/action_controller.rb in logjoy-0.1.0 vs lib/logjoy/log_subscribers/action_controller.rb in logjoy-0.2.0
- old
+ new
@@ -17,17 +17,16 @@
log[:duration] = rounded_ms(event.duration)
log[:params] = cleanup_params(payload[:params])
log[:request_id] = payload[:request].request_id
log[:event] = event.name
log[:allocations] = event.allocations
- log[:custom] = Logjoy.custom_fields(event) if Logjoy.customizer.present?
if log[:status].nil? && (exception_class_name = payload[:exception]&.first)
log[:exception] = exception_class_name
log[:status] = ::ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_class_name)
end
- log.to_json
+ log.merge(Logjoy.custom_fields(event)).to_json
end
end
def logger
::ActionController::Base.logger