$sessionName = OC_Util::getInstanceId();
try {
+ $logger = null;
+ if (Server::get(\OC\SystemConfig::class)->getValue('installed', false)) {
+ $logger = logger('core');
+ }
+
// set the session name to the instance id - which is unique
$session = new \OC\Session\Internal(
$sessionName,
- logger('core'),
+ $logger,
);
$cryptoWrapper = Server::get(\OC\Session\CryptoWrapper::class);
* @param string $name
* @throws \Exception
*/
- public function __construct(string $name,
- private LoggerInterface $logger) {
+ public function __construct(
+ string $name,
+ private ?LoggerInterface $logger,
+ ) {
set_error_handler([$this, 'trapError']);
$this->invoke('session_name', [$name]);
$this->invoke('session_cache_limiter', ['']);
$timeSpent > 0.5 => ILogger::INFO,
default => ILogger::DEBUG,
};
- $this->logger->log(
+ $this->logger?->log(
$logLevel,
"Slow session operation $functionName detected",
[