PHPackages                             rekurzia/yii2-papertrail-log-target - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. rekurzia/yii2-papertrail-log-target

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

rekurzia/yii2-papertrail-log-target
===================================

Minimal implementation of Yii2 log target sending messages to Papertrail

v0.10.0(9y ago)39.7k41MITPHPPHP ~5.6|~7.0

Since Jan 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rekurzia/yii2-papertrail-log-target)[ Packagist](https://packagist.org/packages/rekurzia/yii2-papertrail-log-target)[ Docs](https://github.com/rekurzia/yii2-papertrail-log-target)[ RSS](/packages/rekurzia-yii2-papertrail-log-target/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (1)

Yii2 Papertrail log target
==========================

[](#yii2-papertrail-log-target)

[![Build Status](https://camo.githubusercontent.com/a85ae3d9f9879b131196d8d0b79b8d9723da1da0a7b1a18d278f1b50f9bf11a1/68747470733a2f2f7472617669732d63692e6f72672f72656b75727a69612f796969322d7061706572747261696c2d6c6f672d7461726765742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rekurzia/yii2-papertrail-log-target)[![Latest Stable Version](https://camo.githubusercontent.com/5ee9df4e59f5ac599d79656dec0a6625ded95a6c464f2876e9d0172e8a9c3586/68747470733a2f2f706f7365722e707567782e6f72672f72656b75727a69612f796969322d7061706572747261696c2d6c6f672d7461726765742f76657273696f6e)](https://github.com/rekurzia/yii2-papertrail-log-target/releases)[![Total Downloads](https://camo.githubusercontent.com/10754fa68f6d00eacb8596d989e9bfccaaa6bd8d1bc898180a3a1eef48521315/68747470733a2f2f706f7365722e707567782e6f72672f72656b75727a69612f796969322d7061706572747261696c2d6c6f672d7461726765742f646f776e6c6f616473)](https://packagist.org/packages/rekurzia/yii2-papertrail-log-target)[![License](https://camo.githubusercontent.com/ffb262c47bb2972aa45104560baa8d7db1d8e903dcf5e415c83b173d40d2f880/68747470733a2f2f706f7365722e707567782e6f72672f72656b75727a69612f796969322d7061706572747261696c2d6c6f672d7461726765742f6c6963656e7365)](https://github.com/rekurzia/yii2-papertrail-log-target/blob/master/license.txt)

Yii2 log target which sends log messages to Papertrail.

Installation
------------

[](#installation)

```
composer require rekurzia/yii2-papertrail-log-target

```

Usage
-----

[](#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

[](#configuration-options)

#### `host` and `port`

[](#host-and-port)

Host and port of your Papertrail log destination.

#### `additionalPrefix`

[](#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`

[](#includecontextmessage)

**Optional.** Whether to include also context message. Defaults to `false`.

### Sample output

[](#sample-output)

[![Sample output screenshot](sample.png?raw=true)](sample.png?raw=true)

Usage of `additionalPrefix` highlighted.

License
-------

[](#license)

MIT. See [license](license.txt) file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3397d ago

### Community

---

Top Contributors

[![ujovlado](https://avatars.githubusercontent.com/u/419849?v=4)](https://github.com/ujovlado "ujovlado (2 commits)")

---

Tags

papertrailyii2

### Embed Badge

![Health badge](/badges/rekurzia-yii2-papertrail-log-target/health.svg)

```
[![Health](https://phpackages.com/badges/rekurzia-yii2-papertrail-log-target/health.svg)](https://phpackages.com/packages/rekurzia-yii2-papertrail-log-target)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
