teraone / laravel-newrelic-logger
Installs: 7 054
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: ^8.1
- monolog/monolog: ^3.3
Requires (Dev)
- orchestra/testbench: ^8.0
This package is auto-updated.
Last update: 2024-10-24 17:31:03 UTC
README
This Package adds a Log Driver that formats the logs so the new relic infrastructure agent can parse them properly.
Installation
You can install the package via composer.
For Laravel 10:
composer require teraone/laravel-newrelic-logger:"10.*"
For Laravel 9:
composer require teraone/laravel-newrelic-logger:"9.*"
Usage
Just add a Log Channel with the driver "newrelic" to the logging.php config file:
'newrelic' => [ 'driver' => 'newrelic' ]
There you can configure what else should be included in the logs:
'newrelic' => [ 'driver' => 'newrelic', 'additional_info' => [ 'env' => env('APP_ENV'), 'hostname' => gethostname() ] ]
Then you can set the log channel in the .env file:
LOG_CHANNEL=newrelic
License
The MIT License (MIT). Please see License File for more information.