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

Elastic Audit Laravel Package

tsitsishvili/elastic-audit

A Laravel package for Elasticsearch-backed audit logging. Capture Eloquent model changes and application events, store structured audit records in Elasticsearch, and search or analyze activity trails at scale with a simple, scalable setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit tsitsishvili/elastic-audit is a Laravel-side audit trail package that ships audit events from application code into Elasticsearch. As a service-provider-based Laravel package it slots into the framework's normal configuration/publishing model (config file, facade or injected writer, queued writes), so it does not require architectural change to the host application beyond wiring a new audit channel.

v4.2.0 strengthens the package's fit for regulated or security-sensitive workloads in three ways:

  • Audit failure observability — audit pipelines that fail silently are a control gap, not a bug. Surfacing write failures turns "we think we're logging" into "we can prove we're logging," which is the prerequisite for using this package as an evidence source rather than a debugging convenience.
  • Schema health checks — audit indices are long-lived and their mappings drift. A check that validates the expected document schema against the live index reduces the risk of a mapping conflict silently rejecting documents mid-incident.
  • Source identity — additional provenance on emitted events improves forensic value (which system/path produced the record) and is the most likely source of schema-level impact on consumers.

Integration feasibility Low-to-moderate effort for a greenfield adoption; moderate for existing 4.1.x consumers. The release is a minor version with no declared breaking changes, so Composer-level adoption should be a constraint bump plus composer update. The real work is downstream, not in the package install:

  • Guzzle bump (PR #18) is the highest-probability friction point. Laravel applications routinely pin guzzlehttp/guzzle transitively via HTTP clients, SDKs, and Elasticsearch clients. Expect to resolve a constraint conflict in some applications and to re-run the HTTP integration test suite after resolution.
  • Source identity likely adds fields to the audit document. If the target index uses strict or dynamic: false mappings, new fields will be dropped or rejected. Consumers must confirm index template/mapping updates land before or with the application deploy, and must verify that field-level security or index permissions allow the new fields.
  • Schema health checks imply new configuration and possibly new failure semantics (does a failed health check abort boot, log a warning, or expose an endpoint?). This must be determined before rollout; a check that fails closed on application boot is a production availability risk if the cluster is unreachable.
  • The CI dependency bumps (checkout, postcss) are maintenance-only and carry no runtime implication.

Technical risk

  • Medium — failure-semantics change. Adding observability to a previously quiet failure path often means new exceptions, log noise, or alerting volume. If audit writes were failing in production and nobody knew, expect a burst of newly visible errors immediately after upgrade. That is desirable but should be staged, not discovered on a peak-traffic day.
  • Medium — schema/mapping drift. New provenance fields against an existing index with restrictive mappings can cause silent document rejection. This is the classic audit-trail failure: writes appear successful at the application layer, documents never arrive.
  • Low-to-medium — dependency conflict. Guzzle version bump can block installation or, worse, resolve to a version that another package has not validated.
  • Low — configuration surface growth. More knobs (health check, observability) means more ways to misconfigure in each environment.
  • Unknown — maintainer concentration. All feature PRs in this release are from a single author, and the project carries a bus-factor risk typical of single-maintainer packages sitting on a compliance-critical path.

Key questions

  1. Does audit failure observability change runtime behavior — does a failed write now throw, and is that configurable per environment?
  2. Does the schema health check run on boot, on demand (artisan/endpoint), or on a schedule? What is its behavior when Elasticsearch is unreachable?
  3. Which document fields does source identity add, and are they additive-only or does any existing field change name or type?
  4. What are the supported PHP / Laravel / Elasticsearch server version ranges for 4.2.0, and is Guzzle 7.x still supported?
  5. Are index templates or migrations shipped in the package, or is mapping management left to the consumer?
  6. What is the documented support and security-patch commitment for the 4.x line?

Integration Approach

Stack fit Assumes a Laravel application (service provider + config publishing), PHP 8.x, Composer, and an Elasticsearch cluster reachable from the application tier. Fits naturally wherever the team already treats Elasticsearch as the observability/audit backend; introduces a second write path (and a second availability dependency) where it does not. Because audit writes are on the request path by default unless queued, the package's placement relative to the request lifecycle is an architectural decision, not a configuration detail.

Migration path

  1. Inventory — enumerate all applications on elastic-audit, note current pinned version (target 4.1.x → 4.2.0), and identify any that have not yet adopted 4.x.
  2. Constraint check — run composer why guzzlehttp/guzzle and a dry-run update against 4.2.0 across the estate before committing anything. Classify apps as "clean," "conflict-resolvable," "blocked."
  3. Schema first — apply the source-identity field additions to index templates/mappings and to any downstream consumers (dashboards, SIEM ingestion, retention jobs) before upgrading application code. Additive fields against permissive mappings are low risk; renamed or retyped fields are not.
  4. Pilot — one non-critical application in staging with the health check enabled in report-only mode; verify documents arrive, fields populate, and failure observability produces the expected signal by deliberately breaking cluster connectivity.
  5. Production rollout — canary one application, watch error-log volume and audit document counts for a defined window, then proceed in waves aligned to application criticality.
  6. Guardrail — pin the exact version (4.2.0) rather than a caret range for the first adoption cycle; loosen after the pilot proves stable.

Compatibility Verify against the matrix that actually matters for the estate: PHP minor, Laravel major (and the supported floor), Guzzle major, Elasticsearch server major, and the Elasticsearch PHP client version the package pulls in. Server-side mapping compatibility is the constraint most likely to bite, because it is invisible until documents stop arriving.

Sequencing Mappings/templates → downstream consumers (dashboards, SIEM parsers) → dependency resolution → application code upgrade in canary → wider rollout. Do not invert this: upgrading code before mappings means a window where provenance fields are silently dropped, which is exactly the evidence you would need if that window contained an incident.

Operational Impact

Maintenance Routine and low-ceremony at the package level — minor version, no declared deprecations, dependency bumps handled by Dependabot. The maintenance load is mostly on the consumer side: keeping index templates in sync with the package's document schema, and keeping the Elasticsearch cluster version inside the supported range. Budget recurring effort for schema-drift review each time the package adds fields, and note that single-maintainer projects warrant an internal fork-or-vendor contingency plan given the compliance role this package plays.

Support Support boundary needs to be explicit before this becomes an audit-of-record system: who owns cluster availability, who owns mapping drift, who responds when audit writes fail at 2 a.m. The new failure observability is only valuable if it is wired into that on-call path — an alert that no one receives is the same as no alert. Confirm the maintainer's responsiveness and security-disclosure process; for a package in the audit path, a 30-day patch SLA is a reasonable ask.

Scaling Audit volume scales with request volume, and Elasticsearch write throughput, index count, and shard sizing become the binding constraints — not the package. Two scaling decisions to make deliberately:

  • Buffered/queued writes. Synchronous writes put the cluster on the critical path of every request and turn a cluster brownout into an application outage. Queued writes decouple that but introduce loss windows on queue failure; the new failure observability should be configured to cover the queue path, not just the direct-write path.
  • Index lifecycle. Daily/rolling indices, ILM policy, and retention must be settled before volume grows, because retrofitting ILM onto a large unmanaged index set is disruptive.

Failure modes

Failure Symptom Mitigation
Elasticsearch unreachable Request latency spikes or exceptions if writes are synchronous Queue writes; circuit breaker; define degrade-open vs. degrade-closed policy per environment
Mapping conflict on new source-identity fields Documents silently rejected; audit counts diverge from request counts Apply mappings first; run schema health check; alert on document-count delta
Guzzle constraint conflict Install blocked or unrelated HTTP integration regressions Pre-flight composer why; re-run HTTP integration tests post-resolution
Health check fails closed on boot Application unavailable because the cluster is unavailable Run in report-only mode; never let a monitoring feature become an availability dependency
Alert fatigue from newly visible failures On-call ignores audit alerts Stage rollout; tune thresholds during pilot; route to a named owner
Single-maintainer abandonment No patches for a compliance-critical dependency Internal fork contingency; version pin; monitor upstream activity

Ramp-up Estimate roughly one to two engineer-days for the pilot (dependency resolution, mapping updates, deliberate failure testing) and a further half-day per subsequent application, assuming mappings are settled. Team-facing enablement is small but non-zero: engineers need to know that audit writes can fail, how to read the new observability signals, and that a red schema health check is a stop-ship condition rather than background noise.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource