1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- use function Hyperf\Support\env;
- $appDebug = (bool)env('APP_DEBUG', false);
- $handlers = $appDebug ? ['debug', 'warning', 'error'] : ['warning', 'error'];
- return [
- 'default' => [
- 'handlers' => $handlers
- ],
- 'debug' => [
- 'handler' => [
- 'class' => \Monolog\Handler\RotatingFileHandler::class,
- 'constructor' => [
- 'filename' => BASE_PATH . '/runtime/logs/hyperf.log',
- 'level' => Monolog\Logger::DEBUG,
- ],
- ],
- 'formatter' => [
- 'class' => Monolog\Formatter\LineFormatter::class,
- 'constructor' => [
- 'format' => null,
- 'dateFormat' => 'Y-m-d H:i:s',
- 'allowInlineLineBreaks' => true,
- ],
- ],
- ],
- 'warning' => [
- 'handler' => [
- 'class' => \Monolog\Handler\RotatingFileHandler::class,
- 'constructor' => [
- 'filename' => BASE_PATH . '/runtime/logs/hyperf-warning.log',
- 'level' => Monolog\Logger::WARNING,
- ],
- ],
- 'formatter' => [
- 'class' => Monolog\Formatter\LineFormatter::class,
- 'constructor' => [
- 'format' => null,
- 'dateFormat' => 'Y-m-d H:i:s',
- 'allowInlineLineBreaks' => true,
- ],
- ],
- ],
- 'error' => [
- 'handler' => [
- 'class' => \Monolog\Handler\RotatingFileHandler::class,
- 'constructor' => [
- 'filename' => BASE_PATH . '/runtime/logs/hyperf-error.log',
- 'level' => Monolog\Logger::ERROR,
- ],
- ],
- 'formatter' => [
- 'class' => Monolog\Formatter\LineFormatter::class,
- 'constructor' => [
- 'format' => null,
- 'dateFormat' => 'Y-m-d H:i:s',
- 'allowInlineLineBreaks' => true,
- ],
- ],
- ]
- ];
|