Via Composer
$ composer require lyal/monolog-logdna
$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!');
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.
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
phpunit
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email lyal@pullrequest.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.