PHPackages                             ercorp/ms-application-insights-monolog - 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. ercorp/ms-application-insights-monolog

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

ercorp/ms-application-insights-monolog
======================================

Microsoft Application Insights integration for monolog. An abstract handler that sends messages to Microsoft Application Insights

v1.0(7y ago)04661MITPHPPHP ^7.1

Since Nov 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/EmergencyReporting/ms-application-insights-monolog)[ Packagist](https://packagist.org/packages/ercorp/ms-application-insights-monolog)[ RSS](/packages/ercorp-ms-application-insights-monolog/feed)WikiDiscussions master Synced today

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

Microsoft Application Insights for Monolog
==========================================

[](#microsoft-application-insights-for-monolog)

Monolog Handler connection to [Microsoft Application Insights](http://azure.microsoft.com/en-gb/services/application-insights/)

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

[](#installation)

Via Composer: Run the following Composer command:

```
composer require ercorp/ms-application-insights-monolog
```

Usage
-----

[](#usage)

A handler is provided that wraps up a Microsoft Application Insights Telemetry client. By default the handler will grab anything at Logger::ERROR and above and send it to Microsoft Application Insights.

```
$logger  = new Monolog\Logger("Example");

$telemetryClient = new \ApplicationInsights\Telemetry_Client();
$telemetryClient->getContext()->setInstrumentationKey('YOUR INSTRUMENTATION KEY');

$msApplicationInsightsHandler = new \Marchie\MSApplicationInsightsMonolog\MSApplicationInsightsHandler($telemetryClient);

$logger->pushHandler($msApplicationInsightsHandler);

// The following error will get sent automatically to Microsoft Application Insights
$logger->addError("oh no!", array('exception' => new \Exception("ohnoception")));
```

Credits
-------

[](#credits)

This package is based on the [MonoSnag](https://github.com/meadsteve/MonoSnag) package. Thanks to Steve Brazier and other contributors to that package.

The package also relies on Microsoft's [ApplicationInsights-PHP](https://github.com/Microsoft/ApplicationInsights-PHP) package.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

2737d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/118b674ab8c2f5252b2906d96ef188a7996b39519dab8fbb8af43c5d13704dcc?d=identicon)[gabema](/maintainers/gabema)

---

Top Contributors

[![gabema](https://avatars.githubusercontent.com/u/1266704?v=4)](https://github.com/gabema "gabema (1 commits)")

---

Tags

loggingerrormicrosoftmonologApplication Insights

### Embed Badge

![Health badge](/badges/ercorp-ms-application-insights-monolog/health.svg)

```
[![Health](https://phpackages.com/badges/ercorp-ms-application-insights-monolog/health.svg)](https://phpackages.com/packages/ercorp-ms-application-insights-monolog)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[mead-steve/mono-snag

Bugsnag integration for monolog. An abstract handler that sends messages to Bugsnag

20533.2k1](/packages/mead-steve-mono-snag)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[kdyby/monolog

Integration of Monolog into Nette Framework

33684.0k10](/packages/kdyby-monolog)[inpsyde/logzio-monolog

Logz.io integration for Monolog

191.2M1](/packages/inpsyde-logzio-monolog)

PHPackages © 2026

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