ThinkPHP开发技巧集锦(3):开启数据库sql⽇志1、config.php
'app_debug' => true,
'log' => [
// ⽇志记录⽅式,内置 file socket ⽀持扩展
'type' => 'File', //设置,test为关闭
// ⽇志保存⽬录
'path' => LOG_PATH,
// ⽇志记录级别
'level' => ['sql'], //设置
],
2、database.php
'debug' => true,
注意:
多数时候,关闭记录⽇志(type=>'test'),只需要记录sql⽇志即可,因此可在 public\index.php中开启sql⽇志记录
\think\Log::init([
'type' => 'File',
'path' => LOG_PATH,
'level' => ['sql']
]);
>thinkphp3
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论