ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\WebDAV\Log\Log Class Reference
+ Inheritance diagram for ILIAS\WebDAV\Log\Log:
+ Collaboration diagram for ILIAS\WebDAV\Log\Log:

Public Member Functions

 __construct (private bool $enable_debugging,)
 
 initialize (Server $server)
 

Private Member Functions

 handleException (\Throwable $e)
 

Private Attributes

ilLogger $logger = null
 
const string EVENT_TYPE_EXCEPTION = 'exception'
 
array $ignore_exceptions
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 34 of file Log.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\WebDAV\Log\Log::__construct ( private bool  $enable_debugging)

Definition at line 36 of file Log.php.

38 {
39 }

Member Function Documentation

◆ handleException()

ILIAS\WebDAV\Log\Log::handleException ( \Throwable  $e)
private

Definition at line 64 of file Log.php.

64 : void
65 {
66 foreach ($this->ignore_exceptions as $ignore_exception) {
67 if ($e instanceof $ignore_exception) {
68 return;
69 }
70 }
71
72 $called_by = $e->getTrace()[0] ?? null;
73 if ($called_by && isset($called_by['class'], $called_by['function'])) {
74 $this->logger->write(
75 'WEBDAV: Exception in ' . $called_by['class'] . '::' . $called_by['function'] . ' - ' . $e->getMessage(
76 ),
77 );
78 } else {
79 $this->logger->write(
80 'WEBDAV: Uncaught exception - ' . $e->getMessage(),
81 );
82 }
83 }

References Vendor\Package\$e, and ILIAS\Repository\logger().

Referenced by ILIAS\WebDAV\Log\Log\initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

ILIAS\WebDAV\Log\Log::initialize ( Server  $server)

Definition at line 51 of file Log.php.

51 : void
52 {
53 $server->on(self::EVENT_TYPE_EXCEPTION, fn() => $this->handleException(func_get_arg(0)));
54
55 // TODO: remove service locator usage
56 global $DIC;
57 $this->logger ??= $DIC->logger()->webdav();
58
59 if ($this->enable_debugging) {
60 $this->ignore_exceptions = [];
61 }
62 }
handleException(\Throwable $e)
Definition: Log.php:64
global $DIC
Definition: shib_login.php:26
$server
Definition: shib_login.php:28

References $DIC, $server, ILIAS\WebDAV\Log\Log\handleException(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Field Documentation

◆ $ignore_exceptions

array ILIAS\WebDAV\Log\Log::$ignore_exceptions
private
Initial value:
= [
NotFound::class,
NotAuthenticated::class,
Locked::class,
ConflictingLock::class,
]

Definition at line 43 of file Log.php.

◆ $logger

ilLogger ILIAS\WebDAV\Log\Log::$logger = null
private

Definition at line 41 of file Log.php.

◆ EVENT_TYPE_EXCEPTION

const string ILIAS\WebDAV\Log\Log::EVENT_TYPE_EXCEPTION = 'exception'
private

Definition at line 42 of file Log.php.


The documentation for this class was generated from the following file: