Download the PHP package arwg/laravel-final-logger without Composer
On this page you can find all versions of the php package arwg/laravel-final-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arwg/laravel-final-logger
More information about arwg/laravel-final-logger
Files in arwg/laravel-final-logger
Package laravel-final-logger
Short Description Laravel package to keep unique consistency of request, response payload and log formats.
License MIT
Homepage https://github.com/Andrew-Kang-G/laravel-final-logger
Informations about the package laravel-final-logger
Laravel-Final-Logger
Overview
Laravel-final-logger provides unique and consistent formats throughout log (all Http, Ajax requests & responses), payload (all Http, Ajax requests & responses), and server-side error log. Also, you can nullify any children properties to reduce the size of logged files.
Installation
config/app.php
bootstrap/app.php
config/final-logger.php (sample)
Usage
Simple to use
1. How to error-log
2. How to general-log
IMPORTANT
Register logging path on 'config/final-logger.php'
Register this Middleware to 'app/Http/Kernal.php'
Set certain properties to empty (due to reducing size of log files or whatever...)
The advantage of the library is that it is possible to set certain properties empty in payload hierarchy. Let's say we are setting the property 'stats' empty and 'img_cnt' empty at an uri (api/v2/final-test-uri/images).
Modify 'config/final-logger.php'.
Now they all have been marked as "xxx" for 'api/v2/final-test-uri/images'.
3. Config file
Check the properties marked 'necessary' below. The others are just what I customized.
4. How to throw errors on codes
For handled errors, use this unique format.
or for unhandled errors. No need to handle any. But if you need...
5. Error logging without throwing exceptions
This doesn't make application stop but just log.
6. Success payload (not necessary)
Samples
1. server-side error log sample
2. response log sample : this is the same as children of the general_log property above.
3. error response payload sample : this is the same as children of the error_payload above.
We focus on the final endpoints, so logging is conducted at the only following two points.
1. Middleware : Response endpoints.
2. The point when the error occurs.
No request endpoint logging is conducted, as the two points can catch all request data.
Changelog
Changelog
License
License File