ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ZendMonitorHandler.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of the Monolog package.
4 *
5 * (c) Jordi Boggiano <j.boggiano@seld.be>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace Monolog\Handler;
12
15
22{
28 protected $levelMap = array(
29 Logger::DEBUG => 1,
30 Logger::INFO => 2,
31 Logger::NOTICE => 3,
32 Logger::WARNING => 4,
33 Logger::ERROR => 5,
35 Logger::ALERT => 7,
37 );
38
46 public function __construct($level = Logger::DEBUG, $bubble = true)
47 {
48 if (!function_exists('zend_monitor_custom_event')) {
49 throw new MissingExtensionException('You must have Zend Server installed in order to use this handler');
50 }
51 parent::__construct($level, $bubble);
52 }
53
57 protected function write(array $record)
58 {
60 $this->levelMap[$record['level']],
61 $record['message'],
62 $record['formatted']
63 );
64 }
65
73 protected function writeZendMonitorCustomEvent($level, $message, $formatted)
74 {
75 zend_monitor_custom_event($level, $message, $formatted);
76 }
77
81 public function getDefaultFormatter()
82 {
83 return new NormalizerFormatter();
84 }
85
91 public function getLevelMap()
92 {
93 return $this->levelMap;
94 }
95}
Normalizes incoming records to remove objects/resources so it's easier to dump to various targets.
Base Handler class providing the Handler structure.
Exception can be thrown if an extension for an handler is missing.
Handler sending logs to Zend Monitor.
writeZendMonitorCustomEvent($level, $message, $formatted)
Write a record to Zend Monitor.
write(array $record)
{Writes the record down to the log of the implementing handler.void}
__construct($level=Logger::DEBUG, $bubble=true)
Construct.
getDefaultFormatter()
{Gets the default formatter.FormatterInterface}
Monolog log channel.
Definition: Logger.php:28
const EMERGENCY
Urgent alert.
Definition: Logger.php:77
const ERROR
Runtime errors.
Definition: Logger.php:57
const CRITICAL
Critical conditions.
Definition: Logger.php:64
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
const INFO
Interesting events.
Definition: Logger.php:39
const DEBUG
Detailed debug information.
Definition: Logger.php:32
const NOTICE
Uncommon events.
Definition: Logger.php:44
const ALERT
Action must be taken immediately.
Definition: Logger.php:72