elpandape/filament-activitylog
Filament Activity Log adds a ready-to-use activity log viewer to your Filament admin panel, letting you browse, search, filter, and inspect recorded model changes and user actions. Built for Laravel and Spatie Activitylog, it helps teams audit changes without leaving Filament.
Architecture fit. This package occupies a well-understood seam in a Laravel application: it decorates the logging pipeline rather than the application code. v1.2.0's logging.stamp_request flag turns a previously passive "context rail" (the properties.ip, properties.via, properties.agent keys) into a self-populating one, applying to every entry regardless of which subsystem wrote it — controllers, jobs, listeners, scheduled commands. That is the correct layer. It means observability becomes a platform concern configured once, instead of a convention every developer must remember at every call site. Low coupling, no domain intrusion, no vendor SDK in the request path.
Integration feasibility. High. The change is a config toggle plus an upstream processor; adopting teams do not touch application code. Two design choices materially reduce integration friction: caller-set keys are left untouched (manual overrides keep working, so adoption is incremental rather than big-bang), and request detection is keyed off client address rather than runningInConsole(). That second point is the release's most defensible engineering decision — SAPI-based checks make tests exercise a different code path than production, which is precisely how "works in CI, silent in prod" bugs are born. A test suite now validates the same logic operators rely on.
Technical risk. Concentrated in the request-detection heuristic, not the stamping itself:
TrustProxies and forwarded-header handling. Misconfiguration yields internal RFC1918 addresses in logs (quietly useless) or, worse, spoofable values presented as fact in an audit trail.Key questions for the maintainers. Where exactly is the client address sourced, and does it honor TrustProxies? How is context scoped and reset in Octane and queue workers? Does the stamp run before or after other processors and formatters, and does it survive config:cache? Is there a redaction, hashing, or sampling option for IP and user-agent? What is the measured per-entry overhead at 10k entries/sec? And is stamp_request default-on or default-off — the blast radius depends entirely on that answer.
Stack fit. Any Laravel application on a Monolog-backed logging channel — single, stack, daily, or JSON-formatted output to stdout for container log collection. It composes cleanly with structured-logging conventions already in place; teams emitting JSON to a collector get queryable ip/via/agent fields with zero formatter changes.
Migration path. Genuinely low-risk because it is additive and non-destructive. Enable the flag, observe, and only then consider deleting the hand-stamped Log::withContext()/pushProcessor calls scattered through the codebase. That removal is a separate, later change with its own review — do not bundle it into the upgrade.
Compatibility. Confirm three environments explicitly: the PHPUnit/Pest suite (the release note suggests this path is now credible — validate it), an Octane/Swoole or RoadRunner deployment if applicable, and a queue-worker deployment. Also confirm minimum Laravel/PHP versions and that the config key is introduced without a publish step that could silently no-op.
Sequencing.
stamp_request off.Maintenance. Small surface: one boolean plus whatever redaction/sampling knobs accompany it. The maintenance burden is not the config — it is the request-detection heuristic, which now depends on network topology (load balancers, CDNs, proxies). Every infrastructure change to the edge becomes a potential silent regression in log fidelity. Budget for a canary assertion that a known request produces a non-empty, non-private ip.
Support. On-call behavior changes subtly and must be documented: a missing ip now means "no client address was observed," not "logging is broken." Conversely, a private-range IP means "proxy trust is misconfigured." Write both into the runbook, because the failure is silent — logs keep flowing, they are just wrong or absent in a field nobody looks at until an incident.
Scaling. Per-entry cost is trivial (config read, string assignment); at high volume it is a real multiplier but unlikely to be the bottleneck. The scaling concern is downstream: log volume, retention cost, and aggregator cardinality. A user-agent field on every entry is the expensive part, not the IP.
Failure modes, ranked.
Ramp-up. Developers: near zero — a flag they do not have to think about, and manual overrides still win. Platform/observability owners: moderate — they own the trust-proxy correctness, the index mappings, the cost delta, and the privacy sign-off. Plan for one platform engineer to own validation, not a team.
Recommendation. Adopt, gated on two answers: how context is scoped in long-lived workers, and whether stamping is opt-in by default. Both are answerable in a single staging exercise. The design instinct behind this release — make the correct behavior automatic and make tests exercise the production path — is exactly right, and the caller-wins precedence rule means adoption carries little downside risk.
How can I help you explore Laravel packages today?