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

* handle log env settings (dooh)

This commit is contained in:
Branko Wilhelm 2019-05-16 18:11:33 +02:00
parent 05e326abe6
commit b551a25391
No known key found for this signature in database
GPG key ID: 3BBFB6DDFBC46B0E
2 changed files with 17 additions and 0 deletions

View file

@ -30,6 +30,11 @@ final class Config
*/ */
private $customerId; private $customerId;
/**
* @var bool
*/
private $log = true;
/** /**
* @var string * @var string
*/ */
@ -104,6 +109,14 @@ final class Config
return $this->customerId; return $this->customerId;
} }
/**
* @return bool
*/
public function isLog()
{
return $this->log;
}
/** /**
* @return string * @return string
*/ */

View file

@ -72,6 +72,10 @@ final class Handler
private function doExit() private function doExit()
{ {
if (!$this->config->isLog()) {
return;
}
// save only the newest 100 log entries for each domain // 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)); $this->log[$this->payload->getDomain()] = array_reverse(array_slice(array_reverse($this->log[$this->payload->getDomain()]), 0, 100));