PHPackages                             bugsnag/bugsnag-psr-logger - 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. bugsnag/bugsnag-psr-logger

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

bugsnag/bugsnag-psr-logger
==========================

Official Bugsnag PHP PSR Logger.

v2.0.0(4y ago)32132.5M—6.4%6[2 PRs](https://github.com/bugsnag/bugsnag-psr-logger/pulls)2MITPHPPHP &gt;=8.0CI passing

Since Jul 7Pushed 8mo ago30 watchersCompare

[ Source](https://github.com/bugsnag/bugsnag-psr-logger)[ Packagist](https://packagist.org/packages/bugsnag/bugsnag-psr-logger)[ Docs](https://github.com/bugsnag/bugsnag-psr)[ RSS](/packages/bugsnag-bugsnag-psr-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (19)Used By (2)

Bugsnag PHP PSR Logger
======================

[](#bugsnag-php-psr-logger)

[![StyleCI Status](https://camo.githubusercontent.com/348c5f79394e400adb28ee70abbee310298a3e5f212d6ebbfba5b9e4a1221bcc/68747470733a2f2f7374796c6563692e696f2f7265706f732f36323034313633352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/62041635)

The Bugsnag PHP PSR logger is an implementation of the [Fig PSR logging standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) that provides a standard interface to logging to Bugsnag.

Getting Started
---------------

[](#getting-started)

### Installing

[](#installing)

Add `bugsnag/bugsnag-psr-logger` to your `composer.json`.

### Configuring

[](#configuring)

This library provides a logger interface but uses the [bugsnag-php notifier library](https://github.com/bugsnag/bugsnag-php) as a base. All configuration should be performed as described in the [official bugsnag-php documentation](https://docs.bugsnag.com/platforms/php/).

### Using the Loggers

[](#using-the-loggers)

The library provides two loggers, `BugsnagLogger` and `MultiLogger`.

`BugsnagLogger` will automatically send a notification to Bugsnag if it receives a message with a severity higher than `info`. This will allow you to notify of any handled exceptions through interfacing the logger directly with the framework you are using. Ensure that the logger can communicate with the `bugsnag-php` library by passing the `client` object into it on creation.

```
$bugsnag = Bugsnag\Client::make('YOUR-API-KEY-HERE');
$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);

# Will send a notification to bugsnag
$logger->error('An error occurred');
```

If you wish to use a separate logger alongside `BugsnagLogger` you will need to use `MultiLogger`. By passing it an array of `Logger` objects on construction, `MultiLogger` will call into each passed `Logger` in turn when a message is logged.

```
$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);
$mySecondLogger = new Logger();
$multiLogger = new Bugsnag\PsrLogger\MultiLogger([$logger, $mySecondLogger]);

# Will log to $mySecondLogger and send a notification to bugsnag through $logger
$multiLogger->error('An error occurred');
```

The default level at which logs will be sent to Bugsnag is `Psr\Log\LogLevel::NOTICE`. This can be overridden using the `setNotifyLevel` function:

```
$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);

# Will not send a notification to bugsnag by default
$logger->info('Some interesting information');

$logger->setNotifyLevel(Psr\Log\LogLevel::INFO);

# Will send a notification to bugsnag
$logger->info('Some more interesting information');
```

For more information on integrating the loggers into specific frameworks see the individual setup information found in the [bugsnag-php documentation](https://docs.bugsnag.com/platforms/php/).

Contributing
------------

[](#contributing)

All contributors are welcome! For information on how to build, test and release `bugsnag-psr-logger`, see our [contributing guide](CONTRIBUTING.md). Feel free to comment on [existing issues](https://github.com/bugsnag/bugsnag-psr-logger/issues)for clarification or starting points.

License
-------

[](#license)

The Bugsnag PSR logger is free software released under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance43

Moderate activity, may be stable

Popularity66

Solid adoption and visibility

Community28

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~217 days

Total

14

Last Release

1587d ago

Major Versions

v1.4.5 → v2.0.02022-01-12

PHP version history (3 changes)v1.0.0PHP &gt;=5.5.9

v1.0.1PHP &gt;=5.5

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/858098655184af201555193635d41f38ed7084a326263bcc973e80dc3851979e?d=identicon)[tomlongridge](/maintainers/tomlongridge)

![](https://www.gravatar.com/avatar/1709000319bfc9a89449207b3481e5f4cba891707f35ab6a2caf0cd1e62e71f6?d=identicon)[agrzegorzewski](/maintainers/agrzegorzewski)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (55 commits)")[![imjoehaines](https://avatars.githubusercontent.com/u/282732?v=4)](https://github.com/imjoehaines "imjoehaines (32 commits)")[![kattrali](https://avatars.githubusercontent.com/u/333454?v=4)](https://github.com/kattrali "kattrali (14 commits)")[![Cawllec](https://avatars.githubusercontent.com/u/7754028?v=4)](https://github.com/Cawllec "Cawllec (8 commits)")[![tomlongridge](https://avatars.githubusercontent.com/u/6351188?v=4)](https://github.com/tomlongridge "tomlongridge (4 commits)")[![ankurk91](https://avatars.githubusercontent.com/u/6111524?v=4)](https://github.com/ankurk91 "ankurk91 (2 commits)")[![mclack](https://avatars.githubusercontent.com/u/89254998?v=4)](https://github.com/mclack "mclack (2 commits)")[![martin308](https://avatars.githubusercontent.com/u/475364?v=4)](https://github.com/martin308 "martin308 (1 commits)")[![snmaynard](https://avatars.githubusercontent.com/u/829837?v=4)](https://github.com/snmaynard "snmaynard (1 commits)")[![alfredbez](https://avatars.githubusercontent.com/u/1001186?v=4)](https://github.com/alfredbez "alfredbez (1 commits)")

---

Tags

bugsnagplatformspsrloggingerrorsexceptionsbugsnagtracking

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bugsnag-bugsnag-psr-logger/health.svg)

```
[![Health](https://phpackages.com/badges/bugsnag-bugsnag-psr-logger/health.svg)](https://phpackages.com/packages/bugsnag-bugsnag-psr-logger)
```

###  Alternatives

[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90334.6M36](/packages/bugsnag-bugsnag-laravel)[bugsnag/bugsnag

Official Bugsnag notifier for PHP applications.

56347.0M78](/packages/bugsnag-bugsnag)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[bugsnag/bugsnag-symfony

Official BugSnag notifier for Symfony applications.

453.0M3](/packages/bugsnag-bugsnag-symfony)[evolution7/bugsnag-bundle

Bugsnag error reporting integration for Symfony2

19126.5k1](/packages/evolution7-bugsnag-bundle)[apix/log

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

511.0M18](/packages/apix-log)

PHPackages © 2026

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