laravel_easy_log / easy_log
A package for logging in Laravel
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/laravel_easy_log/easy_log
Requires
- php: ^7.3|^8.0
- illuminate/support: ^6|^7|^8|^9|^10
README
Description
Laravel Easy Log is a custom logging package for Laravel applications, allowing easy logging of messages with various levels (such as error, info, and success) to a database. It's particularly useful for tracking application behavior and user-specific actions.
Features
- Logs messages with different types (error, success, info).
- Optionally associates logs with user IDs and routes.
- Stores logs in a dedicated
custom_logdatabase table.
Requirements
- PHP >= 7.3
- Laravel 6.x, 7.x, , 8.x , 9.0x or 10.x
Installation
-
Require the Package
Use Composer to install the package. Run the following command in your Laravel project:composer require laravel_easy_log/easy_log
-
Run Migrations
Publish and run the migrations to create thecustom_logtable in your database:php artisan vendor:publish --provider="LaravelEasyLog\EasyLog\CustomLogServiceProvider" --tag="migrations" php artisan migrate
-
Configuration (Optional)
If you want to customize the package, you can publish the configuration file:php artisan vendor:publish --provider="LaravelEasyLog\EasyLog\CustomLogServiceProvider" --tag="config"
Usage
After installing the package, you can log messages like this:
use LaravelEasyLog\EasyLog\Facades\CustomLogger; CustomLogger::log($userId, 'Your log message', 'info', request()->path());
Contributing
Contributions to the Laravel Easy Log package are welcome. Please follow the standard procedures for contributing to open-source projects.
License
This package is open-sourced software licensed under the MIT license.