Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 2.66 KB

README.md

File metadata and controls

82 lines (53 loc) · 2.66 KB

monolog-logdna

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 [email protected] instead of using the issue tracker.

Credits

License

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