Log REPP requests

This commit is contained in:
Martin Lensment 2015-01-13 13:58:38 +02:00
parent 0544dbd3ff
commit 568c52129f
8 changed files with 38 additions and 16 deletions

View file

@ -121,14 +121,15 @@ module Epp::Common
def write_to_epp_log
request_object = OBJECT_TYPES[params_hash['epp']['xmlns:ns2']] if params[:frame]
ApiLog::EppLog.create!({
ApiLog::EppLog.create({
request: params[:frame],
request_command: params[:command],
request_successful: epp_errors.empty?,
request_object: request_object,
response: @response,
api_user_name: @epp_user.try(:to_s) || current_epp_user.try(:to_s),
api_user_registrar: @epp_user.try(:registrar).try(:to_s) || current_epp_user.try(:registrar).try(:to_s)
api_user_registrar: @epp_user.try(:registrar).try(:to_s) || current_epp_user.try(:registrar).try(:to_s),
ip: request.ip
})
end
end