php-sql-logger/README.md
2018-05-02 19:30:51 +08:00

24 lines
541 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Lumen 的sql记录组件
引入该组件后,如果 APP_DEBUG = true 时会自动将sql执行日志记录到 storage/logs/sql-{Y-m-d}.log 中。默认只保留最近15天的日志
### 引入
```bash
composer config repositories.lumen-sql-logger vcs git@git.int.haowumc.com:arch/lumen-sql-logger.git
composer require --dev arch/lumen-sql-logger
```
### 开启
```php
if (env('APP_ENV') == 'local') {
$app->register(Arch\EventServiceProvider::class);
}
```
###配置
在.env中增加如下配置
```bash
APP_NAME = api
```