{"repo":"renuo/rails_api_logger","free":true,"listed":false,"github":"https://github.com/renuo/rails_api_logger","clone":"git clone https://github.com/renuo/rails_api_logger.git","description":"An Inbound and Outbound requests logger for your Rails application","language":"Ruby","stars":69,"topics":["rails","logging","api"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Rails API Logger The simplest way to log API requests in your database. The Rails API logger gem introduces a set of tools to log and debug API requests. It works on two sides: Inbound requests : API exposed by your application Outbound requests : API invoked by your application This gem has been extracted from various Renuo projects. This gem creates two database tables to log the following information: path the path/url invoked method the method used to invoke the API (get, post, put, etc...) request body what was included in the request body response body what was included in the response body response code the HTTP response code of the request started at when the request started ended at when the request finished Installation Add this line to your application's Gemfile: And then execute: This will generate two tables inbound request logs and outbound request logs . These tables will contain the logs. Ensure logging of data RailsApiLogger can use a separate database, to ensure that the logs are written in the database even if a surrounding database transaction is rolled back. Make sure to add the following in your config/environments/production.rb : and configure a new database accordingly. ⚠️ If you skip this step, rails api logger will use your primary database but a rollback will also rollback the writing of logs. If you are not on SQLite you can simply point api logger to the same database! By doing so you can use a single database but still guarantee the writing of lo","default_branch":null,"files":null,"tree":[],"storefront":"/r/renuo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/renuo/rails_api_logger/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}