log.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Env;
  12. // +----------------------------------------------------------------------
  13. // | 日志设置
  14. // +----------------------------------------------------------------------
  15. return [
  16. // 默认日志记录通道
  17. 'default' => Env::get('log.channel', 'file'),
  18. // 日志记录级别
  19. 'level' => ['error', 'warning', 'fail', 'success','debug'],
  20. // 日志类型记录的通道 ['error'=>'email',...]
  21. 'type_channel' => [],
  22. // 是否关闭日志写入
  23. 'close' => false,
  24. //是否开启业务成功日志
  25. 'success_log' => false,
  26. //是否开启业务失败日志
  27. 'fail_log' => false,
  28. // 日志通道列表
  29. 'channels' => [
  30. 'file' => [
  31. // 日志记录方式
  32. 'type' => 'File',
  33. // 日志保存目录
  34. 'path' => app()->getRuntimePath() . 'log' . DIRECTORY_SEPARATOR,
  35. // 单文件日志写入
  36. 'single' => false,
  37. // 独立日志级别
  38. 'apart_level' => ['error','warning','sql', 'fail', 'success','debug'],
  39. // 最大日志文件数量
  40. 'max_files' => 1000,
  41. ],
  42. // 其它日志通道配置
  43. ],
  44. ];