Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Betterstack Logs Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Delivery semantics are unknown from the outside. The handler makes an HTTP call. Whether that call is inline in the request cycle or buffered determines whether logging can add user-facing latency. This must be measured, not assumed — it is the single fact most likely to change the plan.
  • Silent failure is the default convention. Logging libraries swallow transport errors so they cannot cascade. Consequence: a wrong or expired token looks identical to "no traffic." This is a product risk, not just an engineering one, because it means the team can believe it has observability while having none. Mitigation must be planned explicitly (synthetic smoke-test log, alert on ingestion gap).
  • v1.4.0 is a maintenance release. "Improve error handling and enhance test coverage" (PR #6) is directionally reassuring — failures are handled more deliberately and the critical code path now has more tests — but it adds no features, no config keys, and no deprecations. Treat it as low-risk, not as a maturity milestone.
  • Bus factor of one. Single maintainer, 6 stars, low commit velocity. This is acceptable for a ~200-line adapter with a one-line rollback, but it should be recorded as an accepted risk with a named owner, and the team should be willing to fork if necessary.
  • Data governance exposure. Logs leave the estate. PII, tokens, and request bodies in 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):

  1. Does the handler block the request cycle, and what is p99 added latency at our projected volume?
  2. On transport failure: drop, retry, buffer, or throw — and is it configurable?
  3. Does it honor LOG_LEVEL, and can we sample info/debug independently of error?
  4. What are the Monolog 2 vs 3 and Laravel 10/11/12 constraints in composer.json?
  5. Who signs off that a given log field is permitted to leave our infrastructure?
  6. What is the Better Stack ingestion cost at projected volume, and does the package expose batching controls that affect it?

Integration Approach

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):

  1. Spike — 0.5 day. Channel in a scratch app; measure latency; observe behavior with a deliberately invalid token. Exit: we know whether it blocks and what happens on failure.
  2. Staging — 1 day. Route error and above to Better Stack; keep full-fidelity local logging in parallel. Exit: errors arrive and are queryable.
  3. Failure-visibility test — 0.5 day. Break the token in staging and confirm we detect the break, not merely that Better Stack is silent. This is the highest-value step in the whole plan and should be a hard gate, not optional.
  4. Production — sampled. Start at warning+ or sample info. Expand verbosity only after latency and cost are measured against real traffic.
  5. Steady state. Add to dependency-review; watch for the next minor.

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.

Operational Impact

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:

  • Bad or rotated token. Fails quietly. Detect via scheduled synthetic log line plus an alert on ingestion gap, not on application errors.
  • Vendor outage or throttling. Contained by the local file sink in the stack channel.
  • Added request latency. Detected by the spike and by watching p99 after production rollout; mitigated by async/buffering or a lower verbosity tier.
  • PII leakage. No package-level control. Mitigated by review policy, a redaction processor, and a documented list of permitted log fields — a governance deliverable, not an engineering one.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk