PHPackages                             stephanecoinon/papertrail - 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. stephanecoinon/papertrail

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

stephanecoinon/papertrail
=========================

Integrate Papertrail log monitor in your PHP applications

v1.1.0(8y ago)957.5k↓14.3%3MITPHPPHP &gt;=5.4

Since Nov 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/stephanecoinon/papertrail)[ Packagist](https://packagist.org/packages/stephanecoinon/papertrail)[ RSS](/packages/stephanecoinon-papertrail/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

Papertrail PHP Connector
========================

[](#papertrail-php-connector)

[![Build Status](https://camo.githubusercontent.com/4e72c9348e5692cff731501f4d8c5145993a191450413a84d862bc27bcc6d5c8/68747470733a2f2f7472617669732d63692e6f72672f7374657068616e65636f696e6f6e2f7061706572747261696c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/stephanecoinon/papertrail) [![License](https://camo.githubusercontent.com/19da3af1954ed172910ab928d44241ed00965044feb9dfce88c9d57002d9390e/68747470733a2f2f706f7365722e707567782e6f72672f7374657068616e65636f696e6f6e2f7061706572747261696c2f6c6963656e73652e737667)](https://packagist.org/packages/stephanecoinon/papertrail)

Easily integrate [Papertrail log monitor](https://papertrailapp.com) in your PHP applications. This package provides integration for plain vanilla PHP and Laravel.

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

[](#installation)

```
composer require stephanecoinon/papertrail
```

Configuration
-------------

[](#configuration)

It is good practice *not* to include credentials in your code so passwords are not stored in version control. Keeping sensitive info in your code could become an issue when you need to open source or share your code with other developers. For this reason, this package will get your papertrail log server details from environment variables `PAPERTRAIL_HOST` and `PAPERTRAIL_PORT` by default.

This package ships with 2 drivers:

- `Php` for plain PHP applications
- `Laravel` for Laravel applications from version 4.2 to 5.6

### Plain Vanilla PHP

[](#plain-vanilla-php)

For plain PHP applications, we recommend also installing [Monolog](https://github.com/Seldaek/monolog):

```
composer require monolog/monolog
```

then integrate the papertrail package like so:

```
require __DIR__ . '/vendor/autoload.php';

use StephaneCoinon\Papertrail\Php as Papertrail;

// Boot using default settings (ie Papertrail log server and port
// from environment variables and no log message prefix).
// It also gives you a monolog instance in the process.
$logger = Papertrail::boot();

// Now your logs will appear in Papertrail dashboard.
$logger->info('test log');
```

### Laravel 4

[](#laravel-4)

Add these lines in your `start/global.php`:

```
// Pass all parameters
\StephaneCoinon\Papertrail\Laravel::boot($host, $port, $prefix);
```

or

```
// Grab log server details from environment variables and use a prefix
\StephaneCoinon\Papertrail\Laravel::bootWithPrefix('MY_APP');
```

### Laravel 5

[](#laravel-5)

Edit `app/Providers/AppServiceProvider.php` and add this line in `boot` method:

```
\StephaneCoinon\Papertrail\Laravel::boot();
```

then test it's working:

```
// routes/web.php

Route::get('log', function () {
    Log::info('test log', ['foo' => 'bar']);

    return 'Logged';
});
```

API reference
-------------

[](#api-reference)

All drivers provide the following interface:

```
/**
 * Boot connector with given host, port and log message prefix.
 *
 * If host or port are omitted, we'll try to get them from the environment
 * variables PAPERTRAIL_HOST and PAPERTRAIL_PORT.
 *
 * @param  string $host   Papertrail log server, ie log.papertrailapp.com
 * @param  int $port      Papertrail port number for log server
 * @param  string $prefix Prefix to use for each log message
 * @return \Psr\Log\LoggerInterface
 */
public static function boot($host = null, $port = null, $prefix = '')
```

```
/**
 * Boot connector using credentials set in environment variables and the
 * given log message prefix.
 *
 * @param string $prefix Prefix to use for each log message
 * @return \Psr\Log\LoggerInterface
 */
public static function bootWithPrefix($prefix)
```

Tests
-----

[](#tests)

First, copy `.env.dist` as `.env` and set your Papertrail host, port and API key in it.

Then run PHPUnit:

```
./vendor/bin/phpunit
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~885 days

Total

2

Last Release

3012d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bcf993deb6f73549b595654664517ba1e7640898ff75bf3b5fac2bdc95dc9fe5?d=identicon)[stephanecoinon](/maintainers/stephanecoinon)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stephanecoinon-papertrail/health.svg)

```
[![Health](https://phpackages.com/badges/stephanecoinon-papertrail/health.svg)](https://phpackages.com/packages/stephanecoinon-papertrail)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M277](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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