- What is mgdsoft/stackdriver-bundle and what does it actually do?
- It is a Symfony bundle that wires Google Stackdriver, now called Google Cloud Operations, into a PHP application. It provides a Monolog handler that ships log records to Cloud Logging and an exception reporter that formats payloads so Cloud Error Reporting groups failures correctly. The value is in the payload shaping: severity mapping, serviceContext, and trace correlation rather than raw log transport.
- Is mgdsoft/stackdriver-bundle a Laravel package?
- No. It is a Symfony bundle, so it ships a DI extension, a configuration tree, service definitions and compiler passes that Laravel's container does not understand. Installing it in a Laravel app gives you no service provider, no config publishing, and none of the auto-wiring the bundle relies on. At most the handler class is conceptually portable because Laravel's logging stack is also Monolog-based.
- Can I install mgdsoft/stackdriver-bundle with Composer in a Laravel project?
- Composer will resolve it, but nothing in Laravel will register or configure it, so you gain an unmaintained transitive dependency without the functionality. You would have to instantiate the handler manually and rewrite its constructor wiring against current Google Cloud PHP SDK classes. In practice it is cheaper to write the handler in-house or use a maintained Monolog handler.
- Does this bundle support Monolog 3 and Laravel 10 or 11?
- It was written against older Monolog and PHP 7.x conventions, and the handler signatures changed in Monolog 2.x and 3.x. Modern Laravel releases ship Monolog 3, so expect return type and interface drift if you try to reuse the class directly. Any lifted code needs a review pass against the current HandlerInterface and AbstractProcessingHandler contracts.
- How do I send Laravel logs to Google Cloud Logging without this bundle?
- Add a custom channel in config/logging.php that builds a Monolog logger with a Google Cloud Logging handler, either via a tap callback or a small factory class. Use google/cloud-logging from the official Google Cloud PHP SDK, which is current and maintained, and attach a formatter that emits severity and logging.googleapis.com/trace fields. That gives you the same outcome as the bundle with dependencies you can upgrade safely.
- What does Cloud Error Reporting need to group Laravel exceptions correctly?
- Error Reporting groups by the exception class and the top frames of the stack trace, so the payload must include a stable, well-formed stack trace plus a serviceContext with your service name and version. Adding the httpRequest object for request-scoped errors and a correct severity improves the signal further. Get this wrong and every exception becomes its own group or unrelated errors merge, which silently degrades alerting until an incident.
- Will this handler work with GKE Workload Identity, Cloud Run or Application Default Credentials?
- Only if the handler resolves credentials through Application Default Credentials rather than a hardcoded service-account JSON path or project ID. Many hand-rolled Stackdriver handlers bake in a key file path, which breaks under GKE Workload Identity and Cloud Run's metadata server. Check the constructor and auth code before assuming it will run unmodified on managed Google Cloud platforms.
- Does logging to Stackdriver add latency to Laravel requests?
- It can, because most simple handlers flush synchronously on the request path, adding Google Cloud API latency to user-facing responses. Under load, a Cloud Logging quota error or outage turns directly into an application latency incident. Prefer buffered or async handlers, or write JSON to stderr on GKE and Cloud Run and let the platform's logging agent ship it.
- How should I test Google Cloud logging and error reporting in a Laravel app?
- Never call the real Google Cloud APIs from your test suite. Bind a fake or in-memory Monolog handler in the test container and assert on the records and formatted payloads, especially severity, serviceContext and trace fields. Keep a small unit test around the payload formatter, since grouping bugs in Error Reporting are invisible until they affect real incidents.
- Is mgdsoft/stackdriver-bundle still maintained, and what should I use instead?
- It is effectively abandoned, with no stars, no dependents and no path for security or PHP 8 fixes, which makes it a poor fit for a Composer lockfile under any vendor review. The practical alternatives are google/cloud-logging and google/cloud-error-reporting used directly in a custom Monolog channel, a maintained community Monolog handler, or an established vendor like Sentry or an OpenTelemetry pipeline. Choose based on whether Google Cloud Operations is your sanctioned observability stack or just one more tool to maintain.