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

Log Viewer Laravel Package

opcodesio/log-viewer

A fast, beautiful Laravel log viewer for browsing and managing logs in storage/logs and beyond. Search and filter entries by level, share links, download/delete files, preview logged mails, support multiple hosts, dark mode, mobile UI, and API access.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Laravel-Native Integration: The package is purpose-built for Laravel, leveraging its core logging infrastructure (storage/logs) and service container. It integrates seamlessly with Laravel’s middleware, routing, and dependency injection systems, reducing architectural friction.
  • Modular Design: The package follows a modular approach with clear separation of concerns:
    • Backend: API endpoints for log retrieval, filtering, and management (e.g., FoldersController, LogsController).
    • Frontend: Vue.js-based UI with dynamic log visualization (search, filtering, dark mode).
    • Log Parsers: Customizable parsers for Laravel, Horizon, Apache, Nginx, etc., enabling extensibility for non-standard log formats.
  • Event-Driven Extensibility: Supports custom log parsers and API hooks, allowing TPMs to extend functionality (e.g., adding Slack alerts for critical logs or integrating with monitoring tools like Datadog).
  • Octane Compatibility: Recent updates (v3.24.0) include scoped bindings for Laravel Octane, ensuring compatibility with high-performance Laravel deployments.

Integration Feasibility

  • Low-Coupling: The package does not modify Laravel’s core files; it registers routes, middleware, and service providers via Laravel’s standard mechanisms (config/app.php, routes/web.php). This minimizes merge conflicts in custom Laravel applications.
  • Asset Handling: Frontend assets can be published to public/ or served directly from the vendor directory (v3.22.0), reducing deployment complexity.
  • Configuration-Driven: Key behaviors (e.g., log file paths, API authentication, UI defaults) are configurable via config/log-viewer.php, enabling zero-code customization for most use cases.
  • API-First Design: The package exposes a RESTful API for logs, enabling programmatic access (e.g., for CI/CD pipelines or third-party tools). This aligns with modern Laravel practices (e.g., Laravel Sanctum for API auth).

Technical Risk

  • Log Format Variability: Custom log formats (e.g., non-Laravel applications or proprietary formats) may require additional development effort to create parsers. Mitigation: The package provides a custom parser guide.
  • Performance at Scale: Large log files (>100MB) or high-traffic environments may impact response times due to file I/O. Mitigation:
    • Indexing: The IndexedLogReader (v3.22.0) preserves file metadata for faster queries.
    • Pagination: Log entries are paginated by default (configurable via items_per_page).
    • Caching: TPMs can cache API responses (e.g., using Laravel’s Cache facade) for frequently accessed logs.
  • Security:
    • API Authentication: Requires Laravel Sanctum or similar for protected routes. TPMs must configure this explicitly.
    • File Permissions: Log files must be readable by the web server (e.g., www-data on Linux). Misconfigurations could expose sensitive logs. Mitigation: Use ACLs or adjust storage/logs permissions.
    • Dependency Vulnerabilities: Recent updates (v3.15.5, v2.6.1) patched Axios vulnerabilities. TPMs should monitor for updates.
  • Octane/Horizon Compatibility:
    • Octane: Scoped bindings (v3.24.0) ensure compatibility, but TPMs using Octane should test under load.
    • Horizon: Supports up to v9.20; newer versions may require updates or custom parsers.
  • Frontend Dependencies: Uses Vue 3 and Vite for bundling. TPMs must ensure their Laravel setup supports modern frontend tooling (e.g., Node.js 16+).

Key Questions for TPM

  1. Log Volume and Velocity:
    • What is the expected size and growth rate of log files? Are there plans to implement log rotation or archiving?
    • Will real-time log streaming (e.g., WebSockets) be required, or is periodic polling sufficient?
  2. Access Control:
    • Who should have access to the log viewer (e.g., admins only)? How will authentication be implemented (e.g., Sanctum, API tokens)?
  3. Custom Log Formats:
    • Are there non-standard log formats (e.g., custom application logs, third-party services) that require custom parsers?
  4. Integration with Observability Stack:
    • Will logs be forwarded to external tools (e.g., ELK, Datadog)? If so, how will Log Viewer’s API be used (e.g., for alerting or dashboards)?
  5. Performance SLAs:
    • What are the acceptable response times for log searches/filtering? Are there plans to implement client-side caching or CDN for assets?
  6. Deployment Environment:
    • Will Log Viewer run in shared hosting, containers (Docker), or serverless environments? Are there constraints on file system access or PHP extensions?
  7. Compliance:
    • Are there regulatory requirements (e.g., GDPR) for log retention or access logging? How will Log Viewer’s audit trails be used?

Integration Approach

Stack Fit

  • Laravel Ecosystem:
    • Core: Works out-of-the-box with Laravel 8–13, leveraging its routing, middleware, and service container.
    • Extensions:
      • Horizon: Native support for queue worker logs.
      • Octane: Compatible with Laravel’s high-performance server (v3.24.0).
      • API Platforms: API responses can be consumed by Laravel Fortify, Sanctum, or Passport for secure access.
    • Frontend: Vue 3 + Vite for a modern, reactive UI. Compatible with Laravel Mix or Vite-based setups.
  • Infrastructure:
    • File System: Requires read access to log directories (e.g., storage/logs, /var/log/). Works with local storage, S3, or network mounts (if permissions are configured).
    • PHP Extensions: No additional extensions required beyond Laravel’s defaults.
  • Third-Party Integrations:
    • Monitoring: Logs can be exported via API for tools like Grafana, ELK, or custom scripts.
    • Alerting: TPMs can hook into the API to trigger alerts (e.g., Slack notifications for ERROR logs).

Migration Path

  1. Assessment Phase:
    • Audit existing log formats and access patterns. Identify custom formats requiring parsers.
    • Review current log management workflows (e.g., tailing files, third-party tools) to define replacement use cases.
  2. Pilot Deployment:
    • Install in a staging environment:
      composer require opcodesio/log-viewer
      php artisan log-viewer:publish
      
    • Configure config/log-viewer.php for log paths, authentication, and UI defaults.
    • Test with a subset of logs (e.g., laravel.log) and validate search/filtering.
  3. Gradual Rollout:
    • Phase 1: Replace manual log inspection with Log Viewer for development teams.
    • Phase 2: Integrate API access for monitoring tools (e.g., export logs to ELK).
    • Phase 3: Extend to production (ensure performance meets SLAs; consider caching).
  4. Customization:
    • Implement custom parsers for unsupported log formats.
    • Extend the API for internal tools (e.g., add endpoints for log aggregation).
    • Brand the UI (e.g., customize colors, add company logos via assetsAreCurrent config).

Compatibility

  • Laravel Versions: Officially supports 8–13. TPMs should test edge cases (e.g., Laravel 13’s new features).
  • PHP Versions: Requires PHP 8.0+. Test with PHP 8.2+ for performance optimizations.
  • Frontend Conflicts:
    • Vue 3 may conflict with existing Laravel Mix/Vite setups. Mitigation: Use the package’s built-in asset serving or merge configurations.
    • CSS/JS conflicts are unlikely due to scoped bundling (v3.17.0).
  • Database: No database requirements, but TPMs may want to cache API responses in Redis for performance.
  • Horizon: Works with Horizon v9.20 or earlier. Newer versions may need custom parsers.

Sequencing

  1. Prerequisites:
    • Ensure Laravel is up-to-date (8+).
    • Verify PHP 8.0+ and Node.js 16+ (for Vite) are installed.
    • Configure file permissions for log directories (e.g., chmod -R 755 storage/logs).
  2. Installation:
    • Composer install → Publish assets → Configure config/log-viewer.php.
  3. Testing:
    • Validate log visibility (start with laravel.log).
    • Test API endpoints (/api/log-viewer/folders, /api/log-viewer/logs).
    • Check UI responsiveness and dark mode.
  4. Production Readiness:
    • Implement authentication (e.g., Sanctum middleware).
    • Set up monitoring for
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport