1
0
Fork 0
mirror of https://github.com/fernwerker/ownDynDNS.git synced 2025-07-11 14:45:42 +02:00

minimum improvements on major refoctoring of b2un0:

- updated README.md to new filenames
  - added log.json creation if not existent in Handler.php
This commit is contained in:
Felix Kretschmer 2019-05-16 23:22:13 +02:00
parent b551a25391
commit eb34f44292
2 changed files with 9 additions and 3 deletions

View file

@ -75,6 +75,12 @@ final class Handler
if (!$this->config->isLog()) {
return;
}
if (!file_exists($this->config->getLogFile())) {
if (!touch($this->config->getLogFile())) {
printf('[ERROR] unable to create %s %s', $this->config->getLogFile(), PHP_EOL);
}
}
// save only the newest 100 log entries for each domain
$this->log[$this->payload->getDomain()] = array_reverse(array_slice(array_reverse($this->log[$this->payload->getDomain()]), 0, 100));