Changed Logger Format, SQL connect bugfix
This commit is contained in:
parent
01c0f84272
commit
5d28b5a9fa
@ -92,7 +92,7 @@ class Logger {
|
|||||||
// database logging failed, try to log to file
|
// database logging failed, try to log to file
|
||||||
$module = preg_replace("/[^a-zA-Z0-9-]/", "-", $this->module);
|
$module = preg_replace("/[^a-zA-Z0-9-]/", "-", $this->module);
|
||||||
$date = (\DateTime::createFromFormat('U.u', microtime(true)))->format(self::LOG_FILE_DATE_FORMAT);
|
$date = (\DateTime::createFromFormat('U.u', microtime(true)))->format(self::LOG_FILE_DATE_FORMAT);
|
||||||
$logFile = implode("_", [$module, $severity, $date]) . ".log";
|
$logFile = implode("_", [$date, $module, $severity]) . ".log";
|
||||||
$logPath = implode(DIRECTORY_SEPARATOR, [WEBROOT, "Site", "Logs", $logFile]);
|
$logPath = implode(DIRECTORY_SEPARATOR, [WEBROOT, "Site", "Logs", $logFile]);
|
||||||
@file_put_contents($logPath, $message);
|
@file_put_contents($logPath, $message);
|
||||||
}
|
}
|
||||||
|
@ -89,13 +89,12 @@ class Context {
|
|||||||
if ($this->sql->isConnected()) {
|
if ($this->sql->isConnected()) {
|
||||||
$settings = $this->configuration->getSettings();
|
$settings = $this->configuration->getSettings();
|
||||||
$settings->loadFromDatabase($this);
|
$settings->loadFromDatabase($this);
|
||||||
return $this->sql;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->sql = null;
|
$this->sql = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return $this->sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSQL(): ?SQL {
|
public function getSQL(): ?SQL {
|
||||||
|
Loading…
Reference in New Issue
Block a user