log.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. return [
  15. 'mini_protection' => [
  16. 'handlers' => [
  17. [
  18. 'class' => Monolog\Handler\RotatingFileHandler::class,
  19. 'constructor' => [runtime_path() . '/logs/mini-protection.log', 14, Monolog\Logger::WARNING],
  20. 'formatter' => [
  21. 'class' => Monolog\Formatter\JsonFormatter::class,
  22. 'constructor' => [],
  23. ],
  24. ],
  25. ],
  26. ],
  27. 'default' => [
  28. 'handlers' => [
  29. [
  30. 'class' => Monolog\Handler\RotatingFileHandler::class,
  31. 'constructor' => [
  32. runtime_path() . '/logs/webman.log',
  33. 7, //$maxFiles
  34. Monolog\Logger::DEBUG,
  35. ],
  36. 'formatter' => [
  37. 'class' => Monolog\Formatter\LineFormatter::class,
  38. 'constructor' => [null, 'Y-m-d H:i:s', true],
  39. ],
  40. ],
  41. ],
  42. ],
  43. ];