rekurzia / yii2-papertrail-log-target
Minimal implementation of Yii2 log target sending messages to Papertrail
Installs: 9 536
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: ~5.6|~7.0
- ext-sockets: *
- monolog/monolog: ~1.0
- yiisoft/yii2: ~2.0
Requires (Dev)
This package is not auto-updated.
Last update: 2024-11-10 02:34:56 UTC
README
Yii2 log target which sends log messages to Papertrail.
Installation
composer require rekurzia/yii2-papertrail-log-target
Usage
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; }, ], ];
Configuration options
host
and port
Host and port of your Papertrail log destination.
additionalPrefix
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.
includeContextMessage
Optional. Whether to include also context message. Defaults to false
.
Sample output
Usage of additionalPrefix
highlighted.
License
MIT. See license file.