This commit is contained in:
2023-04-16 02:46:54 +08:00
parent d3897d3337
commit 03ee9b4275
3 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -128,7 +128,7 @@ class AsyncServer implements ServerInterface
$this->server->set($this->systemConfig($config, $daemon)); $this->server->set($this->systemConfig($config, $daemon));
$this->logger->alert('Listen ' . $config->type . ' address ' . $config->host . '::' . $config->port); \Kiri::getLogger()->alert('Listen ' . $config->type . ' address ' . $config->host . '::' . $config->port);
$this->onEventListen($this->server, Config::get('server.events', [])); $this->onEventListen($this->server, Config::get('server.events', []));
$this->onEventListen($this->server, $config->events); $this->onEventListen($this->server, $config->events);
@@ -171,7 +171,7 @@ class AsyncServer implements ServerInterface
throw new Exception('Listen port fail.' . swoole_last_error()); throw new Exception('Listen port fail.' . swoole_last_error());
} }
$this->logger->alert('Listen ' . $config->type . ' address ' . $config->host . '::' . $config->port); \Kiri::getLogger()->alert('Listen ' . $config->type . ' address ' . $config->host . '::' . $config->port);
$port->set($this->resetSettings($config->type, $config->settings)); $port->set($this->resetSettings($config->type, $config->settings));
@@ -187,10 +187,10 @@ class AsyncServer implements ServerInterface
public function onSigint($no, array $signInfo): void public function onSigint($no, array $signInfo): void
{ {
try { try {
$this->logger->alert('Pid ' . getmypid() . ' get signo ' . $no); \Kiri::getLogger()->alert('Pid ' . getmypid() . ' get signo ' . $no);
$this->shutdown(); $this->shutdown();
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->logger->error($exception->getMessage()); \Kiri::getLogger()->error($exception->getMessage());
} }
} }
+2 -2
View File
@@ -144,10 +144,10 @@ class CoroutineServer implements ServerInterface
public function onSigint($no, array $signInfo): void public function onSigint($no, array $signInfo): void
{ {
try { try {
$this->logger->alert('Pid ' . getmypid() . ' get signo ' . $no); \Kiri::getLogger()->alert('Pid ' . getmypid() . ' get signo ' . $no);
$this->shutdown(); $this->shutdown();
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->logger->error($exception->getMessage()); \Kiri::getLogger()->error($exception->getMessage());
} }
} }
+1 -1
View File
@@ -112,7 +112,7 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server
$worker_id, $worker_pid, $signal, $exit_code, swoole_strerror(swoole_last_error(), 9) $worker_id, $worker_pid, $signal, $exit_code, swoole_strerror(swoole_last_error(), 9)
); );
$this->logger->error($message); \Kiri::getLogger()->error($message);
$this->system_mail($message); $this->system_mail($message);
} }