mgdsoft/stackdriver-bundle
A Symfony bundle for integrating Google Stackdriver services into your PHP application, helping route logs and errors to Google Cloud observability tooling with minimal configuration.
Architecture fit
The package is mislabeled in the request: mgdsoft/stackdriver-bundle is a Symfony bundle, not a Laravel package. Its value proposition is twofold — a Monolog handler that ships records to Google Stackdriver (now Google Cloud Operations: Cloud Logging + Error Reporting) and an exception reporter that formats payloads for Error Reporting's grouping rules. Laravel's logging stack is Monolog-based, so the handler concept is portable, but the bundle is not: the Symfony DI extension, configuration tree, service definitions, and compiler passes have no equivalent in Laravel's container. In a Laravel codebase you would consume at most the handler class (and likely have to rewrite its constructor wiring), meaning you inherit the maintenance of a piece of code the vendor has already abandoned. Fit is therefore "conceptually relevant, structurally mismatched."
The underlying capability, however, is real and still needed. GCP-native logging and error grouping are worth having in a Laravel app running on GKE, Cloud Run, or GCE, and doing it well requires more than error_log() — it requires correct severity mapping, logging.googleapis.com/trace / spanId correlation, serviceContext for Error Reporting grouping, and HTTP @type payloads for request-scoped logs. That is exactly the kind of nuance this bundle was written to handle.
Integration feasibility
Low-to-moderate, and almost entirely decoupled from the package itself.
config/logging.php as a custom channel via tap or a Monolog\Handler\HandlerInterface factory. No bundle wiring required.google/cloud-logging and google/cloud-error-reporting (or raw REST via Guzzle). Those are Google-maintained and current; the bundle is just glue.HandlerInterface::handle, AbstractProcessingHandler signatures changed in 2.x/3.x) and PHP 7.x type semantics. Modern Laravel (10/11) ships Monolog 3.x, so signature and return-type drift is near-certain.Technical risk
High, concentrated in supply chain and longevity rather than in the code's logic.
Key questions
google/cloud-logging PSR-3 logger gets us 90% of the value with a maintained dependency.Stack fit
Poor as a package, acceptable as source material. Laravel + Monolog + GCP is a well-trodden combination with official support; the missing piece is only the formatting of Stackdriver-specific fields. That formatting is ~200 lines of well-understood logic that Google documents publicly. The recommended posture is: do not add mgdsoft/stackdriver-bundle to composer.json. Instead, vendor a minimal adapter under app/Support/Logging/ that composes google/cloud-logging and google/cloud-error-reporting, using the bundle's source as a reference implementation for the field names.
Migration path
If the package is already in use:
Log::channel('stackdriver') calls are unchanged.If it is not in use — which the dependency metrics suggest — the migration path is simply "don't start." Document the decision so it does not get re-proposed from a stale Stack Overflow answer.
Compatibility
AbstractProcessingHandler::write() now has array $record): void and HandlerInterface gained close(). Expect compile-time fatals, not subtle runtime bugs — which is at least a fast failure.declare(strict_types=1) discipline; PHP 8.2/8.3 will surface dynamic-property and nullable-parameter deprecations.getContainerExtension() and Configuration tree are inert in Laravel; they must be stripped, not ported.google/cloud-logging and google/cloud-error-reporting current majors are compatible with PHP 8.1+ and Monolog 3 via their PSR-3 logger; use those versions, not whatever the bundle pinned.Sequencing
google/cloud-logging PsrLogger + google/cloud-error-reporting bootstrap; validate severity mapping, trace correlation, and Error Reporting grouping in a non-prod GCP project.config/logging.php, ADC/Workload Identity verified, log-based alerting smoke-tested.Maintenance
This is the dominant cost and the reason to reject the dependency outright. An archived package with zero stars has an effective maintenance burden of 100% internal ownership with 0% upstream contribution path. Every PHP minor upgrade, every Monolog major, every Google Cloud PHP SDK bump becomes a manual patch against code no one on the team wrote. Contrast with the maintainable alternative: Google's own libraries are on a published release cadence, have security disclosure processes, and are covered by most dependency scanners. The forked-adapter approach concentrates the maintenance into a small file the team owns deliberately rather than a directory of unfamiliar Symfony code.
Support
None. No issue tracker activity, no maintainer response, no Stack Overflow corpus, no Slack community. When the handler silently drops records or mis-groups exceptions, the only debugging path is reading the source. For a TPM this matters in incident reviews: "we couldn't determine why logs were missing" is not an acceptable root cause, and with this package it is the likely one. Escalation path is GCP Support for the API, which will not help with a third-party handler's payload shape.
Scaling
Two scaling axes, both problematic with a naive handler:
BatchJob/PsrLogger with a batch processor) and a bounded buffer with an explicit drop policy. Verify the handler supports non-blocking flush before committing.debug in production, or logging full query bindings/request bodies, can produce a four-figure monthly bill that nobody forecast. Set log exclusion filters, default production channels to warning+, and put a budget alert on the Logging SKU before enabling. Error Reporting itself is free but quota-limited per project.Failure modes
google/auth default provider chain) and failing fast at boot in non-prod.serviceContext or missing stack_trace fields cause Error Reporting to fragment one bug into hundreds of groups, or merge distinct bugs. This looks like "fewer errors" on a dashboard and is actively dangerous.logging.googleapis.com/trace populated from the request, correlating logs to traces in Cloud Trace is manual and slow — negating much of the reason to use Stackdriver at all.error+.Ramp-up
Low individual ramp-up, moderate organizational ramp-up. Any PHP engineer can read the handler in an hour. The real ramp-up is GCP observability literacy: log severity mapping, exclusion filters, log-based metrics and alerting, Error Reporting grouping semantics, and IAM for ADC/Workload Identity. Budget for that regardless of which package you choose — it is the actual deliverable. Recommend pairing the adapter work with a written runbook covering "logs are missing," "errors are over-grouped," and "ingestion cost spiked," owned by whoever owns the on-call rotation.
How can I help you explore Laravel packages today?