hxd / query-logger
这是一个将所有数据库查询保存到日志文件的包,并包含一些自定义设置
v1.0.4
2022-09-13 11:40 UTC
Requires
- php: ^7.3|^7.4|^8.0|^8.1
- illuminate/database: ^6|^7|^8|^9
- illuminate/http: ^6|^7|^8|^9
- illuminate/log: ^6|^7|^8|^9
README
这是一个将所有数据库查询保存到日志文件的包,并包含一些自定义设置
安装
您可以通过composer安装此包
composer require hxd/query-logger
使用
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="query-logger-config"
这是发布配置文件的内容
return [ // Enable or disable query logger 'enabled' => env('QUERY_LOGGER_ENABLED', true), // Enable or disable query logger for specific connection 'enable_for_connection' => env('QUERY_LOGGER_ENABLE_FOR_CONNECTION', null), // Channel you want to save query into (must have in laravel logging channel config) 'channel' => env('QUERY_LOGGER_LOG_CHANNEL', 'stack'), // Enable or Disable automatically assign values to the query, // by default the queries will be hidden values to ensure security. // Make sure you know what you're doing when you turn this on 'enable_map_value' => env('QUERY_LOGGER_ENABLE_MAP_VALUE', true), // Log query execute time 'log_execute_time' => env('QUERY_LOGGER_LOG_EXEC_TIME', true), // Look at the name, you know, the threshold to assign "SLOW QUERY" before your query in the log 'slow_query_threshold' => env('QUERY_LOGGER_SLOW_QUERY_THRESHOLD', 0), // Log query execute path 'log_execute_path' => env('QUERY_LOGGER_LOG_EXEC_PATH', true), // Log connetions 'log_connections' => explode(',', env('QUERY_LOGGER_LOG_CONNECTIONS', '')), ];
变更日志
请参阅CHANGELOG了解最近的变化信息。
贡献
有关详细信息,请参阅CONTRIBUTING。
安全
如果您发现任何与安全相关的问题,请通过电子邮件me@hxd.vn联系,而不是使用问题跟踪器。
鸣谢
许可协议
MIT许可(MIT)。有关更多信息,请参阅许可文件。
Laravel Package Boilerplate
此包是使用Laravel Package Boilerplate生成的。