configuration = $configuration; $this->tag = $tag; $path = $configuration.get('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(event: \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); } } ?>