ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
12namespace Monolog\Handler;
13
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}
Logs to syslog service.
__construct($ident, $facility=LOG_USER, $level=Logger::DEBUG, $bubble=true, $logopts=LOG_PID)
close()
{Closes the handler.This will be called automatically when the object is destroyed}
write(array $record)
{Writes the record down to the log of the implementing handler.void}
Monolog log channel.
Definition: Logger.php:28
const DEBUG
Detailed debug information.
Definition: Logger.php:32