19declare(strict_types=1);
23use Sabre\DAV\Exception\NotFound;
24use Sabre\DAV\Exception\NotAuthenticated;
25use Sabre\DAV\Exception\Locked;
26use Sabre\DAV\Exception\ConflictingLock;
27use Sabre\DAV\ServerPlugin;
34class Log extends ServerPlugin
37 private bool $enable_debugging,
45 NotAuthenticated::class,
47 ConflictingLock::class,
57 $this->
logger ??= $DIC->logger()->webdav();
59 if ($this->enable_debugging) {
60 $this->ignore_exceptions = [];
66 foreach ($this->ignore_exceptions as $ignore_exception) {
67 if (
$e instanceof $ignore_exception) {
72 $called_by =
$e->getTrace()[0] ??
null;
73 if ($called_by && isset($called_by[
'class'], $called_by[
'function'])) {
75 'WEBDAV: Exception in ' . $called_by[
'class'] .
'::' . $called_by[
'function'] .
' - ' .
$e->getMessage(
80 'WEBDAV: Uncaught exception - ' . $e->getMessage(),
__construct(private bool $enable_debugging,)
handleException(\Throwable $e)
const string EVENT_TYPE_EXCEPTION
initialize(Server $server)
Component logger with individual log levels by component id.