log.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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'],
  20. // 日志类型记录的通道 ['error'=>'email',...]
  21. 'type_channel' => [],
  22. // 是否关闭日志写入
  23. 'close' => false,
  24. 'record_trace' => false,
  25. // 日志通道列表
  26. 'channels' => [
  27. 'file' => [
  28. // 日志记录方式
  29. 'type' => 'File',
  30. // 日志保存目录
  31. 'path' => app()->getRuntimePath() . 'log' . DIRECTORY_SEPARATOR,
  32. // 单文件日志写入
  33. 'single' => false,
  34. // 独立日志级别
  35. 'apart_level' => [],
  36. // 最大日志文件数量
  37. 'max_files' => 0,
  38. ],
  39. // 其它日志通道配置
  40. ],
  41. ];