Download the PHP package adityasetiono/api-logger-bundle without Composer
On this page you can find all versions of the php package adityasetiono/api-logger-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adityasetiono/api-logger-bundle
More information about adityasetiono/api-logger-bundle
Files in adityasetiono/api-logger-bundle
Package api-logger-bundle
Short Description provides tools for REST API requests logging and profiling
License MIT
Informations about the package api-logger-bundle
SmartGamma API Logger Bundle
About
SmartGamma Symfony2 REST API Logger bundle is a tool that we use to create SmartGamma Symfony2 REST APIs.It enables detailed logging (possible to separate log) for incomming calls for APIs and tracks the duration, requests and responses body. As additional feature, it allows to profile your APIs and tracks slow API calls.
Installation
- Using Composer To install GammaApiLoggerBundle with Composer just add the following to your composer.json file:
Then, you can install the new dependencies by running Composer’s update command from the directory where your composer.json file is located:
Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:
Configuration
By default the bundle is enabled and slow API call limit is 1000ms. To chage these settings either add to your parameters.yml
or add to config.yml
Usage
Once the bundle was enabled, it will start to make logging all requests that have prefix "/api/" in URI to the log as shown on the sample
All API calls will be logged with "info" level. API calls that will take more then "gamma_logger_slow_time_limit" value will be logged with "error" level
Logging to separate log file
In order to have API calls logged in separate files, you can use follow monolog configuration:
TODO
- make hardcoded prefix "/api/" configurable