78 protected function write(array $record)
80 if (!$this->initialized) {
82 register_shutdown_function(array($this,
'close'));
83 $this->initialized =
true;
93 'level' => $this->levelMap[$record[
'level']],
94 'monolog_level' => $record[
'level_name'],
95 'channel' => $record[
'channel'],
96 'datetime' => $record[
'datetime']->format(
'U'),
99 if (isset(
$context[
'exception']) &&
$context[
'exception'] instanceof Exception) {
100 $payload[
'level'] =
$context[
'level'];
104 $this->rollbarNotifier->report_exception($exception,
$context, $payload);
106 $this->rollbarNotifier->report_message(
114 $this->hasRecords =
true;
119 if ($this->hasRecords) {
120 $this->rollbarNotifier->flush();
121 $this->hasRecords =
false;
An exception for terminatinating execution or to throw for unit testing.
Base Handler class providing the Handler structure.
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}
__construct(RollbarNotifier $rollbarNotifier, $level=Logger::ERROR, $bubble=true)
const EMERGENCY
Urgent alert.
const ERROR
Runtime errors.
const CRITICAL
Critical conditions.
const WARNING
Exceptional occurrences that are not errors.
const INFO
Interesting events.
const DEBUG
Detailed debug information.
const NOTICE
Uncommon events.
const ALERT
Action must be taken immediately.