Weave Code
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

Filament Logger Laravel Package

mradder/filament-logger

Community-maintained Filament audit/activity logging built on spatie/laravel-activitylog. Includes a ready-made Activity resource with filters and diffs, CSV/JSON exports, dashboard widgets, and automatic logging for resources, models, auth, notifications, and custom events.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Audit Logging Layer: The package integrates seamlessly with Laravel’s built-in activity logging via spatie/laravel-activitylog, providing a standardized way to track model changes, auth events, and custom domain events. This aligns well with Laravel’s ecosystem and avoids reinventing audit infrastructure.
  • Filament Integration: Built specifically for Filament (v3, v4, v5), it leverages Filament’s resource system to expose audit logs as a first-class UI component. This reduces the need for custom admin panels or third-party tools.
  • Extensibility: Supports custom events, alerts, and dashboards, making it adaptable for compliance, security monitoring, or operational insights. The API for custom events is well-documented, allowing TPMs to extend functionality without deep code changes.

Integration Feasibility

  • Low-Coupling Design: The package is modular—it doesn’t override core Laravel/Filament behavior but hooks into existing systems (e.g., model observers, auth listeners). This minimizes merge conflicts and reduces risk of breaking changes.
  • Compatibility: Explicitly supports Filament 3/4/5 and Laravel 11/12/13, with clear version constraints. The CI matrix ensures compatibility is tested across these versions.
  • Migration Path: The filament-logger:install command handles config publishing and migrations, simplifying onboarding. Existing audit logs (if using Spatie’s activity log) can be retrofitted with minimal effort.

Technical Risk

  • Filament Version Lock: Requires Filament ≥4.3.1 due to a security fix. Projects using older Filament versions (e.g., 4.0–4.2) must upgrade, which may introduce compatibility risks.
  • Data Migration: Historical logs may contain unsanitized sensitive data (e.g., passwords, tokens). Retroactive scrubbing is manual, requiring a data migration plan.
  • Performance: Large-scale audit logs could impact database performance. The package includes pruning tools, but TPMs must configure retention policies upfront (e.g., filament-logger:prune).
  • Authorization: Strict by default—requires explicit policy support for the activity resource. Projects without Filament policies may need additional setup.

Key Questions

  1. Compliance Requirements: Does the organization need exportable audit trails (CSV/JSON) for regulatory compliance (e.g., GDPR, HIPAA)? If so, the package’s export features must be validated.
  2. Sensitive Data Handling: Are there fields (e.g., PII, API keys) that must be redacted by default? The package supports per-model/per-resource ignore lists, but custom redaction logic may be needed.
  3. Alerting Needs: Should alerts trigger for specific events (e.g., bulk deletes, failed logins)? The alert system supports Slack/Discord webhooks and cooldowns, but use cases must be mapped to event types.
  4. Scaling: How many audit events are expected daily? The package’s performance under high write loads (e.g., >10K events/day) should be benchmarked.
  5. Multi-Guard Auth: Is the application using multiple auth guards (e.g., web + API)? The package supports guard filtering, but TPMs must configure access.guards explicitly.

Integration Approach

Stack Fit

  • Laravel Ecosystem: Built on Spatie’s activity log, which is a mature, widely adopted package. Integrates natively with Laravel’s event system, Eloquent models, and Filament’s resource layer.
  • Filament-Specific: Designed for Filament’s admin panel, providing a UI that matches Filament’s design system (e.g., widgets, tabs, search filters). Avoids the need for custom admin interfaces.
  • PHP Version: Requires PHP 8.2+, which aligns with Laravel’s LTS support. No polyfills or legacy code are needed.

Migration Path

  1. Assessment Phase:
    • Audit existing logging (e.g., custom logs, Spatie activity log, or third-party tools).
    • Identify gaps (e.g., missing auth events, lack of exports) and map them to the package’s features.
  2. Pilot Deployment:
    • Install in a staging environment: composer require mradder/filament-logger.
    • Run php artisan filament-logger:install and php artisan migrate.
    • Register the activity resource in PanelProvider.
  3. Phased Rollout:
    • Start with core features (model logging, auth events) and enable exports/alerts later.
    • Use the ignored_fields config to exclude non-critical fields during pilot.
  4. Data Backfill:
    • For existing systems, consider a one-time script to backfill historical logs into the new structure (if using Spatie’s activity log).

Compatibility

  • Filament Versions: Tested against v3, v4 (≥4.3.1), and v5. Projects on unsupported versions must upgrade.
  • Custom Resources: Automatically logs Filament resources, but custom model observers may need adjustments if they conflict with the package’s observers.
  • Third-Party Packages: No known conflicts with popular Laravel packages (e.g., Laravel Fortify, Sanctum), but TPMs should verify auth event listeners.

Sequencing

  1. Core Setup:
    • Install package, publish config, and run migrations.
    • Configure config/filament-logger.php (e.g., ignored_fields, access.guards).
  2. UI Integration:
    • Register the activity resource in PanelProvider.
    • Customize the resource (e.g., add tabs, modify widgets) via Filament’s resource overrides.
  3. Advanced Features:
    • Enable exports (CSV/JSON) by configuring the export section.
    • Set up alerts for sensitive events (e.g., filament-logger:alert command).
    • Schedule pruning: php artisan schedule:run (if using Laravel’s scheduler).
  4. Validation:
    • Test edge cases (e.g., bulk operations, custom events).
    • Verify performance under load (e.g., simulate 1K events/day).

Operational Impact

Maintenance

  • Configuration-Driven: Most settings are configurable via config/filament-logger.php, reducing the need for code changes.
  • Updates: Follows semantic versioning. Breaking changes are reserved for v2.0.0, so minor updates are low-risk.
  • Dependencies: Relies on Spatie’s activity log and Filament, both of which are actively maintained. Dependency updates should be monitored.

Support

  • Documentation: Comprehensive docs cover installation, security, custom events, and troubleshooting. The VitePress site is well-structured.
  • Community: MIT-licensed with active maintenance (last release: 2026-05-26). GitHub issues and PRs are responsive.
  • Debugging: Logs errors to Laravel’s log channel. The package includes test coverage for core features, aiding in diagnostics.

Scaling

  • Database Load: Audit logs can grow large. The filament-logger:prune command supports retention by age/log name. Consider:
    • Partitioning the activity_log table by date.
    • Archiving old logs to cold storage (e.g., S3) via custom scripts.
  • Performance: Benchmark with expected event volume. For high-throughput systems:
    • Use database indexing on log_name, created_at, and properties->user_id.
    • Consider async logging for non-critical events (e.g., via Laravel queues).
  • Caching: The Filament UI caches resource data. Ensure cache invalidation aligns with audit log updates.

Failure Modes

  • Logging Failures: If the activity_log table is inaccessible, the package will log errors but continue running. Critical failures should trigger alerts (e.g., via Laravel’s failed job queue).
  • Authorization Errors: Strict access control may block users from viewing logs. Ensure policies are configured or disable strict mode in config/filament-logger.php.
  • Data Corruption: Manual database changes to the activity_log table could break the package. Use migrations for schema changes.
  • Alert Storms: Repeated alerts (e.g., failed logins) can be mitigated with cooldowns (alert_cooldown_minutes).

Ramp-Up

  • Developer Onboarding:
    • 1–2 Hours: Install and configure basic logging (model/auth events).
    • 4–8 Hours: Customize the activity resource (tabs, widgets, exports).
    • 1 Day: Implement custom events and alerts.
  • Non-Technical Users:
    • Filament’s UI is intuitive. Users can filter logs by date, user, or event type without training.
    • Exports (CSV/JSON) require minimal setup but may need documentation for end users.
  • Training Needs:
    • Security teams should understand alert triggers and log redaction.
    • DevOps may need to configure pruning and monitor database growth.
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours