This commit is contained in:
xl
2023-07-06 13:33:50 +08:00
parent c22d7a36a0
commit 95915678c3
2 changed files with 169 additions and 170 deletions
+2 -2
View File
@@ -171,7 +171,7 @@ class Logger implements LoggerInterface
if (!in_array($level, $this->levels)) { if (!in_array($level, $this->levels)) {
return; return;
} }
$_string = "[" . now() . ']' . ucfirst($level) . ": " . $message; $_string = "[" . now() . ']: ' . $message;
if (!empty($context)) { if (!empty($context)) {
$_string .= PHP_EOL . $this->_string($context); $_string .= PHP_EOL . $this->_string($context);
} }
@@ -187,7 +187,7 @@ class Logger implements LoggerInterface
file_put_contents('php://output', $message . PHP_EOL); file_put_contents('php://output', $message . PHP_EOL);
} }
$filename = storage('log-' . date('Y-m-d') . '.log', 'log/'); $filename = storage('/log-' . date('Y-m-d') . '.log', 'log/' . $level . '/');
file_put_contents($filename, $_string, FILE_APPEND); file_put_contents($filename, $_string, FILE_APPEND);
} }
-1
View File
@@ -4,7 +4,6 @@
namespace Kiri\Pool; namespace Kiri\Pool;
use Database\Mysql\PDO;
use Exception; use Exception;
use Kiri\Abstracts\Component; use Kiri\Abstracts\Component;
use Kiri\Exception\ConfigException; use Kiri\Exception\ConfigException;