PHPackages                             butopea/monolog-logdna - 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. butopea/monolog-logdna

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

butopea/monolog-logdna
======================

Logdna handler for Monolog

2.1.5(5y ago)019.2k3[1 issues](https://github.com/butopea/monolog-logdna/issues)1LGPL-3.0-onlyPHPPHP ^7.0

Since May 4Pushed 5y agoCompare

[ Source](https://github.com/butopea/monolog-logdna)[ Packagist](https://packagist.org/packages/butopea/monolog-logdna)[ Docs](http://github.com/butopea/monolog-logdna)[ RSS](/packages/butopea-monolog-logdna/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (14)Used By (1)

[LogDNA](https://logdna.com/) handler for [Monolog](https://github.com/Seldaek/monolog)
=======================================================================================

[](#logdna-handler-for-monolog)

Monolog backend for logdna. This backend use logdna [ingestion api](https://docs.logdna.com/v1.0/reference#api).

Install
-------

[](#install)

Install with compose `composer require butopea/monolog-logdna`.

Usage
-----

[](#usage)

```
$logger = new \Monolog\Logger('general');
$logdnaHandler = new \Butopea\Monolog\Handler\LogdnaHandler('your-key', 'myappname', \Monolog\Logger::DEBUG);
$logger->pushHandler($logdnaHandler);

# Sends debug level message "mylog" with some related meta-data
$logger->debug(
  "mylog",
  [
    'logdna-meta-data-field1' => ['value1' => 'value', 'value2' => 5],
    'logdna-meta-data-field2' => ['value1' => 'value']
  ]
);

```

Live Example
------------

[](#live-example)

Create the following php script `test.php`. Don't forget to set the ingestion key prior to running this script.

```
