Yii2 log target which sends log messages to Papertrail.
composer require rekurzia/yii2-papertrail-log-target
Add new target to your configuration:
$config['components']['log']['targets'] = [
[
'class' => Rekurzia\Log\PapertrailTarget::class,
'levels' => ['error', 'warning'],
'host' => 'logs[xxx].papertrailapp.com',
'port' => '1234',
'additionalPrefix' => function() {
return Yii::$app->id;
},
],
];
Host and port of your Papertrail log destination.
Optional. A PHP callable which allows you to add additional prefix. Useful when [ip][userI][sessionId]
is not
enough. Setting as in example above, additional prefix [yourApplicationId]
will be added.
Optional. Whether to include also context message. Defaults to false
.
Usage of additionalPrefix
highlighted.
MIT. See license file.