mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
log request ip on api endpoints
This commit is contained in:
parent
fbf1b8b525
commit
29429dfd33
@ -51,7 +51,8 @@ module Api
|
||||
application_integration: @application_integration,
|
||||
integration_authorization: @authorization,
|
||||
result: @request_success || :success,
|
||||
updates_used: @updates_used_this_request
|
||||
updates_used: @updates_used_this_request,
|
||||
ip_address: request.remote_ip
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ class CreateApiRequests < ActiveRecord::Migration[6.0]
|
||||
t.references :integration_authorization, null: true, foreign_key: true
|
||||
t.string :result
|
||||
t.integer :updates_used, default: 0
|
||||
t.string :ip_address
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@ -46,6 +46,7 @@ ActiveRecord::Schema.define(version: 2020_09_12_000306) do
|
||||
t.integer "integration_authorization_id"
|
||||
t.string "result"
|
||||
t.integer "updates_used", default: 0
|
||||
t.string "ip_address"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["application_integration_id"], name: "index_api_requests_on_application_integration_id"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user