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

Nova Log Viewer Laravel Package

laravel/nova-log-viewer

View and search your Laravel application logs directly inside Laravel Nova. Nova Log Viewer adds a simple tool UI with real-time polling support, making it easy to inspect errors, stack traces, and recent log entries without leaving the admin panel.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Nova-Native Integration: The package is designed as a Nova tool, making it a seamless extension for teams already using Laravel Nova for admin interfaces. It leverages Nova’s tooling ecosystem (e.g., tools() method in NovaServiceProvider), ensuring consistency in UI/UX and authentication.
  • Log-Centric Specialization: Focuses solely on log visualization, avoiding the complexity of full-fledged observability platforms (e.g., Sentry, Datadog). Ideal for teams needing lightweight, UI-based log access without CLI dependency.
  • Polling as a Core Feature: Real-time log updates via polling align with Nova’s reactive frontend, reducing the need for manual refreshes. However, this introduces server-side overhead that must be monitored.

Integration Feasibility

  • Minimal Boilerplate: Installation requires only:
    1. Composer install (laravel/nova-log-viewer).
    2. Registration in NovaServiceProvider::tools().
    • Time Estimate: <30 minutes for basic setup.
  • Dependency Compatibility:
    • Laravel: 8.x–13.x (explicitly tested; see releases).
    • Nova: 4.x+ (requires Nova 5.7.7+ for latest version).
    • Log Drivers: Supports all Laravel log drivers (single, daily, syslog), but performance varies (e.g., single files may be slower for large logs).
  • Monolithic vs. Modular:
    • Best Fit: Monolithic Laravel apps with Nova.
    • Limited Fit: Microservices or headless Laravel APIs (no admin panel context).

Technical Risk

Risk Severity Mitigation
Nova Version Lock-in High Monitor Nova’s backward compatibility; test upgrades early.
Polling Performance Medium Benchmark with high log volumes; adjust LOG_VIEWER_POLLING_INTERVAL.
Log File Permissions Medium Ensure Nova’s storage permissions align with Laravel’s log directory.
Customization Limits Low Fork the package or extend via Nova’s tool API if UI/UX changes are needed.
Security Gaps Low No built-in RBAC for log access; rely on Nova’s existing auth (e.g., roles/gates).

Key Questions

  1. Strategic Alignment:
    • Is Nova a core part of our stack, or is this a temporary tool?
    • Does this replace existing log tools (e.g., Sentry) or complement them?
  2. Operational Constraints:
    • What is our log volume? Will polling scale (e.g., 10K+ logs/min)?
    • Are logs sensitive? How will access be controlled beyond Nova’s auth?
  3. Maintenance:
    • Who will own updates if Nova or Laravel breaks compatibility?
    • Is the team comfortable with forking if custom features are needed?
  4. Alternatives:
    • Would a custom Nova tool (with advanced features) be more valuable?
    • Should we integrate with existing log management (e.g., ELK, CloudWatch)?

Integration Approach

Stack Fit

  • Primary Use Case:
    • Teams using Laravel Nova for admin panels and needing log visibility without CLI.
    • DevOps/Support teams debugging production issues in real-time.
  • Non-Fit Scenarios:
    • Headless APIs: No admin panel context.
    • High-scale log aggregation: Replace with dedicated tools (e.g., ELK, Datadog).
    • CLI-first workflows: Teams preferring tail -f or log:view commands.
  • Alternatives Evaluated:
    • Laravel Horizon: Better for queue/worker logs but lacks Nova integration.
    • Custom Nova Tool: Justifiable if advanced features (e.g., log correlation) are needed.
    • Third-Party Plugins: E.g., spatie/laravel-log-viewer (CLI-focused).

Migration Path

  1. Pre-Installation:
    • Audit Compatibility:
      • Verify Nova version (nova-log-viewer requires Nova 4+).
      • Check Laravel log drivers (e.g., daily vs. single files).
    • Backup Logs: Ensure critical logs are archived before enabling polling.
  2. Installation:
    • Composer:
      composer require laravel/nova-log-viewer
      
    • Nova Registration:
      // app/Providers/NovaServiceProvider.php
      public function tools()
      {
          return [
              \Laravel\Nova\LogViewer\LogViewer::make()
                  ->withPollingInterval(10), // Customize interval (seconds)
          ];
      }
      
    • Publish Assets (if customizing UI):
      php artisan vendor:publish --tag=nova-log-viewer
      
  3. Post-Installation:
    • Test Polling: Simulate high log volume to validate performance.
    • Monitor Resources: Check CPU/memory usage during polling.
    • Document Workflow: Train team on filtering/searching logs in Nova.

Compatibility

Component Supported Versions Notes
Laravel 8.x–13.x Tested explicitly in releases.
Nova 4.x+ (latest: 5.7.7+) Requires Nova 5 for v1.1.0+.
Log Drivers single, daily, syslog, etc. Performance varies; single files may lag with >10K entries.
Browser Modern (Nova’s Vue.js requirements) Ensure compatibility with team’s browser support policy.
PHP 8.0+ Aligns with Laravel 8+ requirements.

Sequencing

  1. Phase 1: Basic Setup (1–2 days)
    • Install and validate log viewing without polling.
    • Test with a single log file (e.g., laravel.log).
  2. Phase 2: Polling Validation (1 day)
    • Enable polling and test under load (e.g., simulate 1K logs/min).
    • Adjust LOG_VIEWER_POLLING_INTERVAL if needed.
  3. Phase 3: Customization (Optional, 2–4 days)
    • Extend UI (e.g., add log level filters) via Nova’s tool API.
    • Integrate with existing workflows (e.g., link to Nova resources).
  4. Phase 4: Rollout & Documentation
    • Document for the team (e.g., "How to debug X using Nova Log Viewer").
    • Train support/DevOps on real-time triage workflows.

Operational Impact

Maintenance

  • Update Strategy:
    • Follow Nova’s release cycle; minimal maintenance expected.
    • Monitor laravel/nova and laravel/framework for breaking changes.
  • Dependency Management:
    • Critical Path: laravel/nova, laravel/framework.
    • Low Risk: NPM dependencies (Vue.js) are managed by Nova.
  • Customization:
    • Forking: Required if extending core functionality (e.g., adding log search).
    • Asset Publishing: Use php artisan vendor:publish for UI changes.

Support

  • Troubleshooting Common Issues:
    Issue Root Cause Solution
    Log viewer blank/403 Auth middleware missing Ensure Authenticate middleware is registered (fixed in v1.2.0).
    Polling timeouts High log volume or slow I/O Reduce polling interval or optimize log drivers.
    "File not found" errors Log file permissions Run chmod -R 755 storage/logs.
    UI lag with large logs Frontend rendering overhead Filter logs by level/keyword before viewing.
  • Team Skills:
    • Required: Familiarity with Nova and Laravel’s logging system.
    • Nice-to-Have: Basic Vue.js for UI customizations.
  • Vendor Lock-in:
    • Risk: Tight coupling with Nova may complicate migrations.
    • Mitigation: Document workarounds for Nova-specific features.

Scaling

  • Performance Bottlenecks:
    • Polling Overhead: Each poll reads log files; high frequency (e.g., 1s) may strain I/O.
      • Mitigation: Use LOG_VIEWER_POLLING_INTERVAL=10 (default) or disable
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony