X7ROOT File Manager
Current Path:
/usr/share/doc/cpanel-php84-log/examples
usr
/
share
/
doc
/
cpanel-php84-log
/
examples
/
📁
..
📄
composite.php
(302 B)
📄
console.php
(148 B)
📄
display.php
(270 B)
📄
error_log.php
(168 B)
📄
file.php
(210 B)
📄
firebug.php
(208 B)
📄
mail.php
(220 B)
📄
null.php
(132 B)
📄
observer_mail.php
(672 B)
📄
pear_error_handler.php
(619 B)
📄
php_error_handler.php
(767 B)
📄
sql.php
(214 B)
📄
sqlite.php
(482 B)
📄
syslog.php
(155 B)
📄
win.php
(202 B)
Editing: observer_mail.php
<?php require_once 'Log/observer.php'; class Log_observer_mail extends Log_observer { private $to = ''; private $subject = ''; private $pattern = ''; public function __construct($priority, $conf) { /* Call the base class constructor. */ parent::__construct($priority); /* Configure the observer. */ $this->to = $conf['to']; $this->subject = $conf['subject']; $this->pattern = $conf['pattern']; } public function notify($event): void { if (preg_match($this->pattern, $event['message']) != 0) { mail($this->to, $this->subject, $event['message']); } } } ?>
Upload File
Create Folder