gietos / yii2-sentry-log
This package is abandoned and no longer maintained.
No replacement package was suggested.
Simple Yii2 Sentry target for logging (http://getsentry.com)
0.0.1
2015-05-18 22:20 UTC
Requires
- php: >=5.4.0
- raven/raven: ~0.11.0
Requires (Dev)
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2015-11-04 18:31:52 UTC
README
Yii2 Sentry target for logging based on Raven client.
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require opus-online/yii2-sentry-log "dev-master"
or add
"opus-online/yii2-sentry-log": "~1.0.0"
to the require
section of your composer.json
file.
Usage
Add target class in your project config:
'components' => [
'log' => [
'targets' => [
[
'class' => 'sentry\SentryTarget',
'levels' => ['error', 'warning'], // or smth else
'dsn' => '', // sentry access string
],
],
],
Then use like ordinary log:
Yii::error('some string');
or
Yii::error([
'msg' => 'some message',
'data' => [...], // Any pair key=>value for adding to the sentry message
]);
Note
Because the mechanism of logging is asyncronical, standard sentry stacktrace is unavailable. But this extension sends logger stacktrace in extra parameters of message.