'/var/log/logbook/', )); $path = $hardcoded_configuration->get('path'); if (\core\config\GlobalConfiguration::exists('class', 'core', 'log', 'client', 'settings')) { $configuration = \core\config\GlobalConfiguration::read('class', 'core', 'log', 'client', 'settings'); if ($configuration->exists('path')) { $path = $configuration->get('path'); } } $this->tag = $tag; $path = new \core\Path($path); # WARNING: must be absolute path $path->safe_append($tag->generate_id()); $this->file = \fopen($path->__tostring(), 'a'); if (!$this->file) { \throw new \core\log\LogException(_('cannot open log file'), 1); } } public funtion push(\core\log\Event $event) : \core\log\Event { if (!\flock($this->file, \LOCK_EX)) { \throw new \core\log\LogException(_( 'cannot guarantee that the file is not already being edited' )); } \fwrite($this->file, $event->display()); \flock($this->file, LOCK_UN); return $event; } } ?>