ias/newrelic-logger-bundle
A Symfony bundle that integrates New Relic logging with your application's Monolog setup, forwarding log records to New Relic for centralized visibility and analysis. Simplifies configuring a New Relic log handler so you can correlate application events with observability data without custom wiring.
Architecture fit — not a Laravel package, and that is the decisive fact. ias/newrelic-logger-bundle is a Symfony bundle: a Bundle subclass, a DependencyInjection\Extension with a config tree, and a compiler pass that wires a Monolog handler into Symfony's monolog service definitions. Laravel has no bundle, extension, or compiler-pass concept. Composer-installing it into a Laravel app yields an inert package — no auto-discovery, no config/logging.php channel, no handler registration — while dragging symfony/http-kernel and symfony/dependency-injection into the dependency graph for a single handler class.
The one genuinely reusable artifact is the handler: an AbstractProcessingHandler subclass that formats records and POSTs them to the New Relic Logs API (log-api.newrelic.com/log/v1, EU variant log-api.eu.newrelic.com) with an ingest license key. That class is framework-agnostic and is the only thing worth extracting.
Integration feasibility — low for the package, medium for the pattern. For a TPM, the important move is to force a build-vs-buy-vs-configure decision before anyone writes code. New Relic's supported path for PHP logs is agent-based forwarding: emit structured JSON to stdout/file and let the New Relic PHP agent or infrastructure agent tail and forward it. That is zero custom code, vendor-supported, and inherits agent-side batching and backpressure. A second option is newrelic/monolog-enricher, which adds trace/span correlation to records rather than shipping them itself. A hand-rolled HTTP handler is defensible only when agent installation is impossible — locked-down containers, shared hosting, serverless.
Technical risk — high, concentrated in provenance. Archived status is decisive. Zero stars and zero dependents mean no downstream users have stress-tested it, no issue history exists to mine, no CVE feed covers it, and nobody will fix a Monolog 3 signature break or a New Relic API change. Secondary risks: synchronous per-record HTTP calls on the request path; license keys handled as plain config rather than secrets; regional endpoint mismatch silently dropping logs; PII leaving the perimeter into a third-party SaaS; and unbounded ingest cost absent sampling or level filtering.
Key questions for the team:
Stack fit. Target Laravel 9–11 on Monolog 3. Any port must be validated against Monolog 3's handler API (AbstractProcessingHandler::write() signature, LogRecord value object) — code written against Monolog 1/2 will not load. Confirm the transport (Guzzle vs. Symfony HttpClient) matches what the app already ships so the port does not introduce a second HTTP client.
Migration path. Do not add the bundle to composer.json. Three routes, in preference order:
stderr/stdout via Laravel's Stderr/Single channel with a JSON formatter and let the New Relic agent forward. No custom code, vendor-supported, security-response coverage included.newrelic/monolog-enricher plus agent forwarding, giving trace correlation without a bespoke sender.app/Logging/, wrap it in a Laravel custom channel driver registered via Log::extend(), add tests, and treat it as first-party code from that moment forward.Compatibility. Pin PHP and Monolog versions in the fork's composer.json; add a contract test asserting a record reaches a mocked New Relic endpoint with the expected envelope (message, timestamp, service.name, attributes, trace.id/span.id). Verify TLS and proxy egress rules to the New Relic endpoint from every environment, including CI and staging.
Sequencing.
StreamHandler composed as a guaranteed fallback.Maintenance. Archiving transfers all upkeep to us: an internal fork, a pinned version, vendoring or publication to a private registry, an assigned owner, and a calendar review tied to Monolog and PHP major upgrades. Small in hours, real in ownership — and it will be forgotten until it breaks at the worst possible time.
Support. No upstream maintainer, no escalation channel, no community to lean on. New Relic will support their Logs API; they will not debug our handler. MIT licensing permits the fork, which is the only reason this remains viable at all — and is exactly why the vendor-supported path is cheaper in practice.
Scaling. The dominant concern is that a synchronous HTTP POST per record couples request latency and reliability to a third-party SaaS. At meaningful volume this is untenable without batching (multi-record payloads), level filtering or sampling at the channel, async/queued flush, a sub-second timeout, and a circuit breaker that degrades silently to local logging rather than failing the request. Ingest volume also maps directly to spend — a runaway debug-level channel produces a surprising bill.
Failure modes to design for explicitly.
Ramp-up. A senior Laravel engineer ports the handler and stands up the channel in one to two days including tests; the larger effort is New Relic agent and API configuration familiarity plus getting fallback and alerting right. The real constraint is evidential: a 0-star, 0-dependent, archived package carries no proof of having run in production anywhere, so every behavior must be verified rather than assumed. Recommendation to leadership: use it as a design reference for what the Monolog-to-New Relic contract looks like, and build or configure the real path on the vendor-supported route.
How can I help you explore Laravel packages today?