Installation
bash
composer require laranex/laravel-newrelicThe service provider is auto-discovered and registers a newrelic log channel. Point your logs at it and give it a license (ingest) key:
env
LOG_CHANNEL=newrelic
NEW_RELIC_LICENSE_KEY=your-ingest-license-keyNEW_RELIC_API_KEY is still accepted when NEW_RELIC_LICENSE_KEY is not set. When neither is set, the New Relic PHP agent's newrelic.license INI value is used.
Publish the config file (optional):
bash
php artisan vendor:publish --tag="newrelic-config"This writes config/newrelic.php. The newrelic tag publishes the same file.
New Relic PHP agent
The New Relic PHP agent is optional. Without it, logs are still shipped to New Relic Logs. With it, logs are linked to their APM transaction (logs in context) and Octane requests are reported as separate, route-named transactions. The agent reports queue jobs as their own transactions by itself.