ludovicose / logger
Log
Installs: 8 206
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
Requires (Dev)
- squizlabs/php_codesniffer: 3.*
- vimeo/psalm: ^4.18.1
This package is auto-updated.
Last update: 2025-04-29 01:36:07 UTC
README
Overview
This PHP library enhances logging capabilities by incorporating a unique identifier (UUID) into each log entry, specifically tied to individual requests. The inclusion of UUIDs facilitates efficient log retrieval, allowing users to trace data associated with a particular request from the beginning to the end of the PHP script execution.
Features
Request UUID Logging
The library assigns a UUID to each log entry, offering a convenient means of searching and analyzing logs related to a specific request. This feature proves invaluable for troubleshooting and comprehending the flow of requests within your PHP application.
Middleware Group Logging
If a middleware group is specified in the configuration file, the library logs requests and user responses associated with that group.
Example configuration:
'middleware_groups' => [ 'web', 'api' ],
HTTP Request Logging
Enabling HTTP request logging captures details about communication between servers, including information about incoming and outgoing HTTP requests.
'enable_http_log' => true
Eloquent Event Logging
The library can log all Eloquent model events, including save, edit, and other related activities. This feature is useful for monitoring changes to your application's data.
'enable_eloquent_log' => true,
Database Query Logging
Enabling database query logging helps keep track of all queries made to the database, aiding in performance optimization and debugging database-related issues.
'enable_query_log' => true,
Installation
composer require ludovicose/logger
Copy the configuration file to your project and customize it according to your requirements.
php artisan vendor:publish --provider="Ludovicose\Logger\PackageServiceProvider" --tag="config"
Once installed and configured, the logger will automatically start capturing logs based on your specified settings.