log.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * This file is part of webman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. use support\facade\Logger;
  15. return array_merge(
  16. [
  17. 'default' => [
  18. 'handlers' => [
  19. [
  20. 'class' => Monolog\Handler\RotatingFileHandler::class,
  21. 'constructor' => [
  22. runtime_path() . '/logs/webman.log',
  23. 7, //$maxFiles
  24. Monolog\Logger::DEBUG,
  25. ],
  26. 'formatter' => [
  27. 'class' => Monolog\Formatter\LineFormatter::class,
  28. 'constructor' => [null, 'Y-m-d H:i:s', true],
  29. ],
  30. ]
  31. ],
  32. ],
  33. ],
  34. Logger::getLogChannelConfigs(), // merge 这个
  35. );