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 for logs across all HTTP and Ajax requests and responses, as well as server-side error logs. Additionally, it allows you to nullify any child properties to reduce the size of log 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 allows you to set certain properties to empty within the payload hierarchy to reduce the size of log files or for other reasons. For example, you can set the properties 'stats' and 'img_cnt' to empty for a specific 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 only at the following two points:
1. Middleware : Response endpoints.
2. The point when the error occurs.
No logging is conducted at the request endpoints, as the two points mentioned above can capture all request data.
Changelog
Changelog
License
License File