rekurzia/yii2-papertrail-log-target

Minimal implementation of Yii2 log target sending messages to Papertrail

v0.10.0 2017-01-22 18:53 UTC

This package is not auto-updated.

Last update: 2024-04-13 23:46:30 UTC


README

Build Status Latest Stable Version Total Downloads License

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

Sample output screenshot

Usage of additionalPrefix highlighted.

License

MIT. See license file.