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 Log Viewer Laravel Package

achyutn/filament-log-viewer

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Core Use Case Alignment: The package directly addresses a critical operational need—log management—within the Filament admin panel ecosystem. It integrates seamlessly with Laravel’s native logging system (Monolog), leveraging existing log files (e.g., storage/logs/laravel.log) without requiring custom log storage solutions.
  • UI/UX Synergy: Built for Filament, it inherits the framework’s design system (e.g., tables, search, pagination), reducing friction for developers accustomed to Filament’s workflow. The table-based display with stack traces and filtering aligns with modern debugging expectations.
  • Extensibility: The package exposes hooks (e.g., custom log paths, log parsers) via Filament’s plugin system, allowing TPMs to extend functionality (e.g., adding log levels, custom metadata columns) without forking.

Integration Feasibility

  • Low-Coupling Design: The package operates as a standalone Filament plugin, requiring minimal Laravel core modifications. It hooks into Filament’s resource system without altering routing, middleware, or business logic.
  • Dependency Stack:
    • Laravel: Compatible with LTS versions (tested against Filament 3.x, Laravel 10/11).
    • Filament: Tightly coupled to Filament’s table/column system; assumes Filament is already in use.
    • Monolog: Relies on Laravel’s default logging setup; no custom log handlers required.
  • Data Flow:
    1. Log files → Monolog → Laravel’s storage → Package’s log reader → Filament’s table renderer.
    2. Search/filter queries are translated to file operations (e.g., grep-like filtering), which may impact performance for large log files (>100MB).

Technical Risk

  • Performance at Scale:
    • Log File Size: Real-time parsing of large log files (e.g., multi-GB) could degrade Filament’s UI responsiveness. Mitigation: Implement lazy-loading or log rotation strategies.
    • Search Overhead: String-based search (e.g., regex) on unindexed log files may be slow. Risk: High for production environments with high-cardinality logs.
  • Log Format Assumptions:
    • Assumes standard Monolog JSON/stack trace formatting. Custom log formats (e.g., syslog) may require configuration or forking.
  • Filament Version Lock:
    • Tied to Filament 3.x; migration risk if upgrading Filament major versions. Check compatibility table for constraints.
  • Security:
    • Logs may contain sensitive data (tokens, PII). Risk: Exposure via UI unless access-controlled (e.g., Filament’s built-in permissions).

Key Questions

  1. Log Volume: What’s the expected log file size/growth rate? Are there plans for log archival or retention policies?
  2. Access Control: How should log visibility be restricted (e.g., by role, environment, or log level)?
  3. Custom Logs: Does the application use non-standard log formats (e.g., Elasticsearch, custom handlers)?
  4. Performance SLA: Are there UI latency thresholds for log searches (e.g., <500ms for 10K logs)?
  5. Audit Needs: Should log actions (e.g., searches, exports) be audited or logged themselves?
  6. CI/CD Impact: How will log viewer changes affect deployment pipelines (e.g., testing, rollback)?

Integration Approach

Stack Fit

  • Primary Stack:
    • Laravel: Native integration with Monolog; no additional infrastructure needed.
    • Filament: Plugin-based; fits into existing Filament admin panels (e.g., resources/ directory).
    • Frontend: Uses Filament’s Alpine.js/Vue.js components; no custom JS required.
  • Secondary Stack:
    • Database: Logs are file-based; no DB schema changes needed.
    • Queue/Jobs: Asynchronous log processing (e.g., for large exports) could leverage Laravel Queues.
  • Tooling:
    • Testing: Log viewer can be tested via Filament’s test helpers (e.g., createTestResource()).
    • Monitoring: Log file sizes/access patterns should be monitored (e.g., via storage/logs/*.log file watchers).

Migration Path

  1. Pre-Integration:
    • Audit existing log formats and retention policies.
    • Ensure Filament 3.x is installed (package dependency).
    • Reserve a route (e.g., /admin/logs) and Filament panel section.
  2. Installation:
    composer require achyutn/filament-log-viewer
    
    • Publish config (if custom paths/parsers needed):
      php artisan vendor:publish --tag="filament-log-viewer-config"
      
  3. Configuration:
    • Register the plugin in app/Providers/Filament/AdminPanelProvider.php:
      ->plugin(FilamentLogViewerPlugin::make())
      
    • Configure log paths, filters, or permissions in config/filament-log-viewer.php.
  4. Post-Integration:
    • Test with sample logs (e.g., php artisan tinker to generate test logs).
    • Validate search/filter performance under load.

Compatibility

  • Laravel: Tested on 10.x/11.x; may need adjustments for older versions (e.g., log path changes).
  • Filament: Requires Filament 3.x; check compatibility table for patch versions.
  • Log Drivers: Primarily supports single (default) and daily log drivers. Custom drivers (e.g., syslog, slack) may need adapter classes.
  • PHP Extensions: None critical; relies on standard file_get_contents, preg_* functions.

Sequencing

  1. Phase 1: Basic Integration
    • Install package, register plugin, test default log display.
    • Validate UI rendering and basic search.
  2. Phase 2: Customization
    • Extend log paths, add custom columns (e.g., user_id from context).
    • Implement access control (e.g., hide sensitive logs from non-admins).
  3. Phase 3: Optimization
    • Add lazy-loading for large logs.
    • Implement log export (CSV/JSON) via Filament’s actions.
  4. Phase 4: Monitoring
    • Set up alerts for log file growth or failed log reads.
    • Log viewer usage analytics (e.g., most-searched terms).

Operational Impact

Maintenance

  • Package Updates:
    • Monitor releases for Filament/Laravel compatibility changes.
    • Upgrade path: Composer updates + config validation (e.g., breaking changes in log parsing).
  • Customizations:
    • Overrides (e.g., custom log parsers) may require updates during package upgrades. Use post-update-cmd in composer.json to validate.
  • Dependency Bloat:
    • Package adds ~500KB to vendor; negligible for most projects but track with composer why-not achyutn/filament-log-viewer.

Support

  • Troubleshooting:
    • Common issues: Log file permissions (chmod -R 755 storage/logs), missing Filament dependencies, or custom log formats.
    • Debugging: Enable debug: true in config to log package errors to Laravel logs.
  • Support Channels:
    • GitHub Issues (48 stars → moderate activity).
    • Filament Discord (community support for Filament-specific quirks).
  • SLA Considerations:
    • Log viewer is non-critical; prioritize support for production log access over feature requests.

Scaling

  • Horizontal Scaling:
    • Log files are static; no distributed coordination needed. However, concurrent reads from multiple app instances may require flock() or file locking.
  • Vertical Scaling:
    • Performance bottlenecks likely tied to log file size. Mitigations:
      • Log Rotation: Configure LOG_MAX_FILES in .env to limit file size (e.g., LOG_MAX_FILES=5).
      • Indexing: Pre-process logs into a searchable DB (e.g., Laravel Scout) for large-scale use.
      • Caching: Cache filtered log queries (e.g., Redis) for repeated searches.
  • High Availability:
    • Log files are single-writer (app); readers (log viewer) can scale independently. Ensure log storage is on shared storage (e.g., NFS) if multi-server.

Failure Modes

Failure Scenario Impact Mitigation
Log file corruption UI shows empty/garbled logs Enable backup log rotation (LOG_BACKUP_COUNT).
Permission denied on storage/logs Log viewer inaccessible Ensure storage:link is run and permissions are 755.
Large log file (>
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.
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
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle