ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
11 namespace Monolog\Handler;
12 
14 use Monolog\Logger;
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,
34  Logger::CRITICAL => 6,
35  Logger::ALERT => 7,
36  Logger::EMERGENCY => 0,
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 }
const NOTICE
Uncommon events.
Definition: Logger.php:44
const DEBUG
Detailed debug information.
Definition: Logger.php:32
const ERROR
Runtime errors.
Definition: Logger.php:57
Base Handler class providing the Handler structure.
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Exception can be thrown if an extension for an handler is missing.
writeZendMonitorCustomEvent($level, $message, $formatted)
Write a record to Zend Monitor.
Normalizes incoming records to remove objects/resources so it&#39;s easier to dump to various targets...
const EMERGENCY
Urgent alert.
Definition: Logger.php:77
Create styles array
The data for the language used.
const CRITICAL
Critical conditions.
Definition: Logger.php:64
Handler sending logs to Zend Monitor.
__construct($level=Logger::DEBUG, $bubble=true)
Construct.
const ALERT
Action must be taken immediately.
Definition: Logger.php:72
const INFO
Interesting events.
Definition: Logger.php:39