-
Notifications
You must be signed in to change notification settings - Fork 22
/
Rollbar.php
59 lines (54 loc) · 1.81 KB
/
Rollbar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace baibaratsky\yii\rollbar;
use Rollbar\Rollbar as BaseRollbar;
use Yii;
use yii\base\BaseObject;
class Rollbar extends BaseObject
{
public $enabled = true;
public $accessToken;
public $baseApiUrl = 'https://api.rollbar.com/api/1/';
public $batchSize;
public $batched;
public $branch;
public $codeVersion;
public $environment;
public $host;
public $includedErrno;
public $logger;
public $personFn;
public $root = '@app';
public $scrubFields = ['passwd', 'password', 'secret', 'auth_token', '_csrf'];
public $timeout = 3;
public $proxy;
public $enableUtf8Sanitization = true;
/**
* @var array Exceptions to be ignored by yii2-rollbar
* Format: ['name of the exception class', 'exception_property' => ['range', 'of', 'values], ...]
*/
public $ignoreExceptions = [
['yii\web\HttpException', 'statusCode' => [404]],
];
public function init()
{
BaseRollbar::init([
'enabled' => $this->enabled,
'access_token' => $this->accessToken,
'base_api_url' => $this->baseApiUrl,
'batch_size' => $this->batchSize,
'batched' => $this->batched,
'branch' => $this->branch,
'code_version' => $this->codeVersion,
'environment' => $this->environment,
'host' => $this->host,
'included_errno' => $this->includedErrno,
'logger' => $this->logger,
'person_fn' => $this->personFn,
'root' => !empty($this->root) ? Yii::getAlias($this->root) : null,
'scrub_fields' => $this->scrubFields,
'timeout' => $this->timeout,
'proxy' => $this->proxy,
'enable_utf8_sanitization' => $this->enableUtf8Sanitization,
], false, false, false);
}
}