2017 © Pedro Peláez
 

library ms-application-insights-monolog

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

image

marchie/ms-application-insights-monolog

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

  • Wednesday, August 5, 2015
  • by marchie
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,266 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Microsoft Application Insights for Monolog

Monolog Handler connection to Microsoft Application Insights, (*1)

Installation

Via Composer: Add the following to your composer.json:, (*2)

  "require": {
        "marchie/ms-application-insights-monolog": "dev-master"
    }

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., (*3)


$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

This package is based on the MonoSnag package. Thanks to Steve Brazier and other contributors to that package., (*4)

The package also relies on Microsoft's ApplicationInsights-PHP package., (*5)

The Versions

05/08 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

logging monolog microsoft error application insights