goedemiddag/betterstack-logs
A Laravel package that integrates Better Stack (formerly Logtail) logging, letting you ship application logs to your Better Stack source with minimal configuration. Monitor, search, and alert on your Laravel logs from one dashboard.
Architecture fit. goedemiddag/betterstack-logs is a Laravel logging channel driver — a service-provider package that registers a Monolog handler to ship logs to Better Stack (formerly Logtail). It does not introduce a new subsystem; it plugs into the config/logging.php channel model that the team already uses. That is the key architectural point for planning: adoption is a configuration and policy decision, not an application change. No schema changes, no new runtime service, no middleware in the request path we control. For an organization already paying for Better Stack, this is the cheapest possible integration. For an organization that has not chosen a log vendor, this package is a consequence of that decision, not a driver of it — the TPM should not let the package's existence manufacture a vendor commitment.
Integration feasibility. High, and small enough to plan in days rather than sprints. The work decomposes into: (1) a spike to verify transport behavior and latency; (2) a config change in config/logging.php; (3) an environment/secrets task to provision the source token per environment; (4) a policy task to decide which channels and levels route remotely; (5) a validation task proving failures are detectable. Items 1–3 are engineering; items 4–5 are where a TPM actually adds value, because "which logs leave our infrastructure, at what verbosity, and who is accountable when shipping silently breaks" are ownership questions that no composer require answers. Recommend a 0.5-day spike plus a 1–2 day implementation and validation for the first environment, then near-zero marginal cost per additional environment.
Technical risk. Moderate, and almost entirely vendor-shaped rather than code-shaped:
Log:: calls are not covered by Laravel's dontFlash/dontReport — that is a code-review and policy problem the package cannot solve.Key questions (each needs an owner and an answer before production):
LOG_LEVEL, and can we sample info/debug independently of error?composer.json?Stack fit. Targets modern Laravel on PHP 8.x with Monolog. Treat as compatible with Laravel 10/11/12 until verified against composer.json — the release notes carry no version-matrix signal, and logging drivers are tightly coupled to both Monolog's handler API and Laravel's LogManager. This verification is a 15-minute task that prevents a multi-day surprise at the next framework major.
Migration path. Non-destructive and reversible — the ideal shape for a change like this. Add a betterstack channel alongside existing single/daily/stderr channels and compose it into the stack channel, so a durable local sink always survives a Better Stack outage. Existing behavior is preserved; rollback is a one-line config revert with no data migration, no dual-write reconciliation, and no cleanup. The blast radius of being wrong is bounded, which is precisely why this should be sequenced early and cheaply rather than gated behind a large programme of work.
Compatibility. v1.4.0 is a semver-minor bump from 1.3.0: no deprecations, no config-key renames, no signature changes. Existing 1.3.x installs can upgrade in place. For new adoption, pin ^1.4 to inherit the improved error handling and test coverage. Note the env() constraint: tokens must be resolved in config/logging.php and never deeper, or config caching will silently null them — a classic "it works locally" failure that should be captured in the runbook, not rediscovered.
Sequencing (with rough effort and exit criteria):
error and above to Better Stack; keep full-fidelity local logging in parallel. Exit: errors arrive and are queryable.warning+ or sample info. Expand verbosity only after latency and cost are measured against real traffic.The sequencing deliberately front-loads the two cheap tests (latency, failure visibility) that can invalidate the plan, so the expensive decision — how much verbosity to ship — is made last, with data.
Maintenance. Low: config-only surface, no custom code, no migrations. The ongoing obligations are dependency review against Laravel/Monolog majors (the realistic breakage vector), token rotation per environment, and keeping the channel definition in version control so the routing policy is reviewable. Total steady-state load is a few hours per quarter, plus the cost of the vendor relationship itself.
Support. The package is single-maintainer OSS under MIT with no SLA — the vendor's SLA covers Better Stack ingestion, not the adapter. The TPM should therefore name an internal owner for the logging configuration (not for the package), and confirm the team is comfortable self-supporting or forking a small adapter. This is a decision to record explicitly rather than leave implicit, because "who do we call when logs stop" currently has no external answer.
Scaling. Two axes. Volume: ingestion is metered, so a debug channel on a busy app can burn quota and hit throttling that presents as dropped logs — set levels per environment deliberately. Latency: if the handler is synchronous, cost scales with request rate and log volume, and slow ingestion can degrade the very requests it is meant to observe — hence the spike. Keep the local file sink in the stack so scaling pressure on the vendor never becomes a logging outage.
Failure modes — each needs a planned detection, not just an acknowledgement:
stack channel.Ramp-up. Low for engineers who already know Laravel logging — roughly half a day to be productive. The real ramp-up is convention, not tooling: agreeing on structured context (order_id as a field, not interpolated into a string) is what makes the vendor spend worthwhile, and it needs a short standard and code-review enforcement to stick. Budget a lightweight team briefing at rollout, and treat "logs are queryable by field, not by grep" as the adoption success metric.
How can I help you explore Laravel packages today?