ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
◀ ilDoc Overview
RollbarHandler.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
RollbarNotifier
;
15
use
Exception
;
16
use
Monolog\Logger
;
17
23
class
RollbarHandler
extends
AbstractProcessingHandler
24
{
30
protected
$rollbarNotifier
;
31
37
public
function
__construct
(
RollbarNotifier
$rollbarNotifier
,
$level
=
Logger::ERROR
,
$bubble
=
true
)
38
{
39
$this->rollbarNotifier =
$rollbarNotifier
;
40
41
parent::__construct(
$level
,
$bubble
);
42
}
43
47
protected
function
write
(array $record)
48
{
49
if
(isset($record[
'context'
][
'exception'
]) && $record[
'context'
][
'exception'
] instanceof
Exception
) {
50
$this->rollbarNotifier->report_exception($record[
'context'
][
'exception'
]);
51
}
else
{
52
$extraData = array(
53
'level'
=> $record[
'level'
],
54
'channel'
=> $record[
'channel'
],
55
'datetime'
=> $record[
'datetime'
]->format(
'U'
),
56
);
57
58
$this->rollbarNotifier->report_message(
59
$record[
'message'
],
60
$record[
'level_name'
],
61
array_merge($record[
'context'
], $record[
'extra'
], $extraData)
62
);
63
}
64
}
65
69
public
function
close
()
70
{
71
$this->rollbarNotifier->flush();
72
}
73
}
Monolog\Handler
Definition:
AbstractHandler.php:12
Monolog\Handler\RollbarHandler\close
close()
{}
Definition:
RollbarHandler.php:69
Monolog\Logger\ERROR
const ERROR
Runtime errors.
Definition:
Logger.php:57
RollbarNotifier
Monolog\Handler\AbstractProcessingHandler
Base Handler class providing the Handler structure.
Definition:
AbstractProcessingHandler.php:22
Monolog\Handler\RollbarHandler\write
write(array $record)
{}
Definition:
RollbarHandler.php:47
Logger
Monolog\Handler\RollbarHandler\__construct
__construct(RollbarNotifier $rollbarNotifier, $level=Logger::ERROR, $bubble=true)
Definition:
RollbarHandler.php:37
Monolog\Handler\AbstractHandler\$level
$level
Definition:
AbstractHandler.php:25
Monolog\Handler\RollbarHandler
Sends errors to Rollbar.
Definition:
RollbarHandler.php:23
Monolog\Handler\RollbarHandler\$rollbarNotifier
$rollbarNotifier
Definition:
RollbarHandler.php:30
Monolog\Handler\AbstractHandler\$bubble
$bubble
Definition:
AbstractHandler.php:26
Exception
Services
Logging
lib
vendor
monolog
monolog
src
Monolog
Handler
RollbarHandler.php
Generated on Wed Aug 27 2025 19:00:55 for ILIAS by
1.8.13 (using
Doxyfile
)