lyal/monolog-logdna

An MIT-licensed package to add LogDNA support to Monolog

dev-master / 1.0.x-dev 2017-12-22 17:46 UTC

This package is auto-updated.

Last update: 2024-11-14 03:57:21 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Install

Via Composer

$ composer require lyal/monolog-logdna

Usage

$logger = new Logger('general');
$logdnaHandler = new LogDNAHandler('YOUR_API_KEY'); // Can also be passed by env
$logger->pushHandler($logdnaHandler); 
$logger->debug('this is my message!');

Notes

Unlike other monolog implementations of json-based log providers, this currently defaults to one request rather than retrying on failure; this will result in a faster request lifecycle and will prevent accidental failure ddosing of LogDNA.

Environment Variables

You can set two environment variables for this library:

APP_ENV -- (string) the environment that the logger is running in

LOGDNA_INGESTION_KEY -- (string) the ingestion key provided in your LogDNA dasbboard

LOGDNA_HOSTNAME -- (string) the host name of the current environment

LOGDNA_HOST_IP -- (ip address) the ip address of the currrent environment

LOGDNA_API_URL -- (url) the base url for your LogDNA service

Testing

phpunit 

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email lyal@pullrequest.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.