Download the PHP package hesamrad/laravel-sql-logger without Composer
On this page you can find all versions of the php package hesamrad/laravel-sql-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hesamrad/laravel-sql-logger
More information about hesamrad/laravel-sql-logger
Files in hesamrad/laravel-sql-logger
Package laravel-sql-logger
Short Description A lightweight package to log SQL queries in your Laravel application
License MIT
Homepage https://github.com/hesamzakerirad/laravel-sql-logger
Informations about the package laravel-sql-logger
Laravel SQL Logger
A lightweight package to log SQL queries in your Laravel application; perfect for debugging and performance analysis during development.
Installation
Install via Composer:
The package will automatically register its service provider.
Configuration
Publish the configuration file:
This will create config/sql-logger.php config file.
Usage
Once installed and configured, SQL logging will automatically start based on your configuration.
Viewing Logs
SQL queries are logged to storage/logs/sql.log by default. You can view them with:
Example Output
Troubleshooting
Log file not created
-
Check
storage/logsdirectory permissions: - Verify
APP_DEBUG=truein your.env - Check current environment is in
allowed_envs - Ensure not running in console mode
Empty or incomplete logs
-
Try disabling file locking:
- Check disk space
- Verify PHP has write permissions
Performance issues
- Set
file_lock' => false - Only enable in specific environments
- Monitor log file size
Multiple separator lines
This indicates the service provider is being instantiated multiple times. Ensure:
- You're using the latest version
static $attachedproperty is working correctly- Only one instance of the provider exists
Security Considerations
⚠️ Important Security Notes:
- Never enable in production unless absolutely necessary
- SQL logs may contain sensitive data (emails, passwords, personal info)
-
Secure the log file:
- Regularly rotate and delete old logs
Support
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Search existing issues
- Create a new issue
License
This package is open-source software licensed under the MIT license.
Credits
- Hesam Rad
- All Contributors
All versions of laravel-sql-logger with dependencies
psr/log Version ^3.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/config Version ^10.0|^11.0|^12.0