ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
SyslogHandler.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Monolog package.
5  *
6  * (c) Jordi Boggiano <j.boggiano@seld.be>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Monolog\Handler;
13 
14 use Monolog\Logger;
15 
30 {
31  protected $ident;
32  protected $logopts;
33 
41  public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
42  {
43  parent::__construct($facility, $level, $bubble);
44 
45  $this->ident = $ident;
46  $this->logopts = $logopts;
47  }
48 
52  public function close()
53  {
54  closelog();
55  }
56 
60  protected function write(array $record)
61  {
62  if (!openlog($this->ident, $this->logopts, $this->facility)) {
63  throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"');
64  }
65  syslog($this->logLevels[$record['level']], (string) $record['formatted']);
66  }
67 }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
Logs to syslog service.
Create styles array
The data for the language used.
__construct($ident, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true, $logopts=LOG_PID)