fix: logging
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -73,9 +73,13 @@ class RemoteService {
|
|||||||
}
|
}
|
||||||
// debugging
|
// debugging
|
||||||
if ($service->getDebug()) {
|
if ($service->getDebug()) {
|
||||||
$logDir = dirname(__DIR__, 5) . '/var/log/jmap/' . $service->identifier() . '.json';
|
$logDirectory = dirname(__DIR__, 5) . '/var/logs/jmap';
|
||||||
|
if (!is_dir($logDirectory) && !mkdir($logDirectory, 0775, true) && !is_dir($logDirectory)) {
|
||||||
|
throw new \RuntimeException(sprintf('Unable to create JMAP log directory: %s', $logDirectory));
|
||||||
|
}
|
||||||
|
$logFile = $logDirectory . '/' . $service->identifier() . '.json';
|
||||||
$client->configureTransportLogState(true);
|
$client->configureTransportLogState(true);
|
||||||
$client->configureTransportLogLocation($logDir);
|
$client->configureTransportLogLocation($logFile);
|
||||||
}
|
}
|
||||||
// return
|
// return
|
||||||
return $client;
|
return $client;
|
||||||
|
|||||||
Reference in New Issue
Block a user