变更
This commit is contained in:
@@ -143,19 +143,20 @@ class Logger implements LoggerInterface
|
||||
{
|
||||
// TODO: Implement log() method.
|
||||
$levels = Config::get('log.level', Logger::LOGGER_LEVELS);
|
||||
if (!in_array($level, $levels) || str_contains($message, 'Event::rshutdown')) {
|
||||
return;
|
||||
if (in_array($level, $levels)) {
|
||||
$_string = '[' . now() . ']' . ucfirst($level) . ': ' . $message . PHP_EOL;
|
||||
if (!empty($context)) {
|
||||
$_string .= $this->_string($context);
|
||||
}
|
||||
if (str_contains($_string, 'Event::rshutdown')) {
|
||||
return;
|
||||
}
|
||||
file_put_contents('php://output', $_string);
|
||||
|
||||
$filename = storage('log-' . date('Y-m-d') . '.log', 'log/');
|
||||
|
||||
file_put_contents($filename, $_string, FILE_APPEND);
|
||||
}
|
||||
|
||||
$_string = '[' . now() . ']' . ucfirst($level) . ': ' . $message . PHP_EOL;
|
||||
if (!empty($context)) {
|
||||
$_string .= $this->_string($context);
|
||||
}
|
||||
file_put_contents('php://output', $_string);
|
||||
|
||||
$filename = storage('log-' . date('Y-m-d') . '.log', 'log/');
|
||||
|
||||
file_put_contents($filename, $_string, FILE_APPEND);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user