- How do I restrict access to the log viewer in production?
- Use the `auth_required=true` config option and set `allowed_emails` or `allowed_ips` in the published config. Alternatively, wrap the route in middleware like `auth` or `can:view-logs`. Default public access is disabled in v0.0.28+.
- Does this package support custom log storage (e.g., S3, remote files)?
- No, it only scans Laravel’s default log directory (`storage/logs/`). For custom paths, you’d need to extend the `LogFileDetector` class or pre-process logs into the standard location.
- What’s the performance impact of tailing large log files (e.g., 500MB+)?
- Client-side filtering helps, but real-time tailing on huge files may strain resources. For production, consider disabling tail mode or pre-filtering logs server-side before passing them to the viewer.
- Can I override the Blade templates to add custom UI elements (e.g., log annotations)?
- Yes, publish the views with `php artisan vendor:publish --tag=log-viewer-views` and modify the Blade files in `resources/views/vendor/log-viewer/`. No API exists for programmatic log access.
- Will this work with Laravel Sanctum or Passport for API-based auth?
- Yes, use middleware like `auth:sanctum` or `auth:api` on the route. The package supports token-based auth as long as Laravel’s auth system validates the request.
- Is there a way to integrate this with monitoring tools like Sentry or Datadog?
- No direct integration exists, but you can download filtered logs as JSON/CSV and forward them to third-party tools. The package doesn’t expose a headless API for programmatic log access.
- What’s the backup plan if this package stops receiving updates?
- The code is MIT-licensed and open-source. You could fork it or migrate to alternatives like Laravel Debugbar (for debugging) or custom log endpoints. No database dependencies make extraction easier.
- Does the auto-refresh feature work well with high-frequency log writes (e.g., 100+ lines/sec)?
- Tail mode may struggle with extreme log volume due to client-side processing. For high-throughput apps, disable auto-refresh or use server-side log aggregation before displaying.
- Can I use this in a Laravel app with Inertia.js/Vue/React frontend?
- Yes, but embed the Blade views directly in your SPA. The package doesn’t provide a dedicated API for SPAs—it’s designed for server-rendered Laravel apps.
- Are there alternatives if I need a headless log API instead of a UI?
- Consider building a custom API endpoint using Laravel’s `Log` facade or tools like Laravel Debugbar’s CLI output. Packages like `spatie/laravel-log` offer structured log access but lack a UI.