lyal / monolog-logdna
An MIT-licensed package to add LogDNA support to Monolog
Requires
- php: ~7.0|~7.1
- guzzlehttp/guzzle: ^6.3
- monolog/monolog: ^1.23
- nesbot/carbon: ^1.22
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2024-11-14 03:57:21 UTC
README
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.