PHPackages                             phippsytech/monologsnag - 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. phippsytech/monologsnag

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

phippsytech/monologsnag
=======================

A handler for monolog that logs to LogSnag

1.0.3(3y ago)012MITPHP

Since Jan 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/phippsytech/monologsnag)[ Packagist](https://packagist.org/packages/phippsytech/monologsnag)[ Docs](https://github.com/phippsytech/monologsnag)[ RSS](/packages/phippsytech-monologsnag/feed)WikiDiscussions main Synced 1mo ago

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

MonoLogSnag
===========

[](#monologsnag)

MonoLogSnag is a handler for Monolog that pushes your logs to [LogSnag](https://logsnag.com), a use-case agnostic event tracking and analytics platform.

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

[](#installation)

To install MonoLogSnag, run the following command:

```
composer require phippsytech/monologsnag

```

Initialising MonoLogSnag
------------------------

[](#initialising-monologsnag)

To use MonoLogSnag with Monolog you need to initialise it like this:

```
use Monolog\Logger;
use PhippsyTech\MonoLogSnag\Handler as MonoLogSnagHandler;

$token = ;
$project = "test";
$channel = "test";

// Create a log channel
$log = new Logger($channel);

// Push the MonoLogSnagHandler to the log channel
$monoLogSnagHandler = new MonoLogSnagHandler($apiKey, $project);
$log->pushHandler($monoLogSnagHandler);
```

To make things easier to read, in all following code snippets I will refer to the above code with `// --> Initialise MonoLogSnag here  Initialise MonoLogSnag here info('Hello World');
```

Adding Description
------------------

[](#adding-description)

In Monolog you can add extra data in the logging context. This is in the form of an array.

MonoLogSnag converts the array into Markdown and sends it via the description:

```
// --> Initialise MonoLogSnag here info('A customer just placed an order', [
    'Product' => "Happy Thoughts",
    'Price' => 1.95
]);
```

Adding Tags
-----------

[](#adding-tags)

LogSnag lets you include up to 5 tags on a log entry. MonoLogSnag uses the `extra` part of a `$record` to hold these tags. You can then filter on these tags in LogSnag.

To add the tags we use the `pushProcessor()` to modify the `$record->extra` array.

In the following example we are adding the log level as a tag named `level`

```
// --> Initialise MonoLogSnag here pushProcessor(function ($record) {
    $record->extra['level'] = $record->level->name;
    return $record;
});

// Send log to LogSnag.  This log is recording a page visit.
$page = $_SERVER['REQUEST_URI'] ?? 'unknown';
$log->info('Page Visit', [
    'page' => $_SERVER['REQUEST_URI']
]);
```

Log Level Icons and Notifications
---------------------------------

[](#log-level-icons-and-notifications)

Currently all log levels have `notify: true`.

The following icons are used for each log level:

debug: 😶
info: 🙂
notice: 🤔
warning: 🧐
error: 😠
critical: 😡
alert: 🤬
emergency: 💀

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Looking Ahead
-------------

[](#looking-ahead)

I plan to add the ability to override the default icon and notify settings in the future. If you'd like to see this happen sooner, please get in touch or consider submitting a pull request with the feature added.

Authors and acknowledgments
---------------------------

[](#authors-and-acknowledgments)

Michael Phipps (Author) - [Twitter](https://twitter.com/PhippsyTech)

LogSnag - [Website](https://logsnag.com) - [GitHub](https://github.com/LogSnag) - [Twitter](https://twitter.com/LogSnag)
Shayan Taslim - [Twitter](https://twitter.com/ImSh4yy)

Monolog - [Website](https://seldaek.github.io/monolog/) - [GitHub](https://github.com/Seldaek/monolog)
Jordi Boggiano - [Twitter](http://twitter.com/seldaek)

License
-------

[](#license)

MonoLogSnag is licensed under the MIT License. See [LICENSE](https://github.com/phippsytech/monologsnag/LICENSE) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

3

Last Release

1222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23db2ce95b18b7c420708571c502c213059e217243a80b182e1b78e81c8df29b?d=identicon)[michaelphipps](/maintainers/michaelphipps)

---

Top Contributors

[![michaelphipps](https://avatars.githubusercontent.com/u/457561?v=4)](https://github.com/michaelphipps "michaelphipps (16 commits)")

---

Tags

logpsr-3logging

### Embed Badge

![Health badge](/badges/phippsytech-monologsnag/health.svg)

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

###  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.9k6](/packages/inpsyde-wonolog)[apix/log

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

511.0M18](/packages/apix-log)[nvanheuverzwijn/monolog-logdna

Mezmo/Logdna handler for Monolog

21231.3k2](/packages/nvanheuverzwijn-monolog-logdna)[elastic/ecs-logging

Format and enrich your log files in the elastic common schema

21907.5k1](/packages/elastic-ecs-logging)

PHPackages © 2026

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