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

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

jeremyharris/psr3-papertrail
============================

PSR-3 logger for Papertrail

1.0.1(8y ago)03.5kMITPHP

Since Jun 3Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/a7594bad5ab223943206fb4363205d9e42c0cd32f8226d77378cf783142e0431/68747470733a2f2f7472617669732d63692e6f72672f6a6572656d796861727269732f707372332d7061706572747261696c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jeremyharris/psr3-papertrail)[![codecov](https://camo.githubusercontent.com/acadf76b2756e8306b2486ee838e215571354430f313dab627a3b1ed99588cd2/68747470733a2f2f636f6465636f762e696f2f67682f6a6572656d796861727269732f707372332d7061706572747261696c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/jeremyharris/psr3-papertrail)[![Packagist](https://camo.githubusercontent.com/64ad80bfc425267a1e454bd28b2bab8df4cf4b83db910f4f89c9940d247fdc0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6572656d796861727269732f707372332d7061706572747261696c2e737667)](https://packagist.org/packages/jeremyharris/psr3-papertrail)![license](https://camo.githubusercontent.com/d358e7076c79911696508f7723cc2edbf715cb51de38d1d9624034a744014c11/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6572656d796861727269732f707372332d7061706572747261696c2e737667)

PSR-3 Papertrail Logger
=======================

[](#psr-3-papertrail-logger)

This is a [PSR-3](http://www.php-fig.org/psr/psr-3/) compatible logger that logs to [Papertrail](https://papertrailapp.com).

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

[](#installation)

```
composer require jeremyharris/psr3-papertrail

```

To log to Papertrail, you must define the following constants with your Papertrail credentials:

- `PAPERTRAIL_HOST`: Your Papertrail host
- `PAPERTRAIL_PORT`: Your Papertrail port

Usage
-----

[](#usage)

```
define('PAPERTRAIL_HOST', 'example.papertrailapp.com');
define('PAPERTRAIL_PORT', 1234);

$logger = new \JeremyHarris\Papertrail\Logger;
$logger->log('error', 'An error occured');
```

For more information about PSR-3 logging, visit the [PSR-3 recommendation](http://www.php-fig.org/psr/psr-3/). This package contains the `\Psr\Log\LogLevel` class for friendly log level constants.

**Note:** Logs are transported over UDP and are therefore fast but fail silently.

### Context Options

[](#context-options)

While no context options are required, you can pass a program and hostname to manually define them.

- `string $program`: Program to use. Uses `'logger'` by default.
- `string $hostname`: Hostname to use. Uses `gethostname()` by default
- `string $facility`: Facility to use. Uses local0 (16) by default. See [RFC 3164](https://tools.ietf.org/html/rfc3164) for details

*This code was mostly taken from the Papertrail docs and [this](https://gist.github.com/troy/2220679) gist.*

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

3266d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e2fcf5bb870eab1f8efd260dfa93fb00961d1c6addc787a93bf0b5d84c78524?d=identicon)[jeremyharris](/maintainers/jeremyharris)

---

Top Contributors

[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (5 commits)")

---

Tags

papertrailpsr-3papertrail

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[monolog/monolog

Sends your logs to files, sockets, inboxes, databases and various web services

21.4k964.9M7.0k](/packages/monolog-monolog)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[samdark/yii2-psr-log-target

Yii 2 log target which uses PSR-3 compatible logger

841.8M10](/packages/samdark-yii2-psr-log-target)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[bref/logger

All you need to log with Bref on AWS Lambda

331.5M8](/packages/bref-logger)

PHPackages © 2026

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