- How do I install haruncpi/laravel-log-reader in a Laravel app?
- Run composer require haruncpi/laravel-log-reader, then publish the package config file with the vendor:publish command. The package auto-registers its route, controller, and Blade view through Laravel's package discovery, so no manual service provider edits are needed. There is no Node build step or asset compilation required. Once installed, the log viewer route is immediately available.
- Which Laravel and PHP versions does laravel-log-reader support?
- The package targets Laravel 5.8 through current releases and works with PHP 7.x and 8.x. It only depends on framework components such as illuminate/support, so it rarely conflicts with application dependencies. Before committing, check the illuminate/support constraint in the package's composer.json against your pinned Laravel version, since that is the most common install-time friction point.
- Is it safe to expose the laravel-log-reader route in production?
- Not by default. The package serves raw log file contents over HTTP, and Laravel logs frequently contain stack traces, SQL queries, request payloads, session identifiers, tokens, and PII, so an unguarded route is a direct information-disclosure risk. At minimum, restrict the route to local and staging environments, or wrap it in auth middleware plus a dedicated gate or IP allowlist before enabling it in production. Treat production exposure as an explicit, reviewed decision rather than a default.
- How do I protect the log viewer route with authentication or a gate?
- The package's config exposes a middleware array for its route, so you can wrap it in web, auth, and a custom gate such as can:view-logs. Register that gate or policy in your AuthServiceProvider and optionally log every open and delete action for an audit trail. Many teams additionally require VPN access or an IP allowlist. You can also gate registration by environment in AppServiceProvider so the route cannot be exposed accidentally.
- Does laravel-log-reader work with the daily channel and custom log file paths?
- Yes, it works out of the box with the default storage/logs/laravel.log file and with daily-channel files such as laravel-2024-05-01.log. Custom log paths and non-standard filenames may require adjusting the package config. It only reads local filesystem channels, so single, daily, and stack-to-file setups are the supported cases.
- Can I delete log files from the dashboard, and is that a compliance concern?
- Yes, the UI includes one-click deletion of log files. That is convenient for cleanup but also a tampering and compliance risk, because many organizations have log retention requirements that forbid ad hoc deletion. Restrict delete access behind authorization, record who deleted what, and confirm your retention posture before enabling the feature outside local development. Without an audit trail, deletion should be considered unsafe in regulated environments.
- Does laravel-log-reader work if my app logs to stdout, CloudWatch, or Papertrail?
- No. The package is a file browser for whatever Laravel's Log facade has written to local disk, so it is effectively meaningless with syslog, Papertrail, CloudWatch, or container stdout logging. On Kubernetes, Heroku, ECS, and other ephemeral or multi-node deployments there often is no stable log file to read. In those setups you need a centralized log aggregator instead.
- How do I change the route prefix or middleware for the log reader?
- Publish the package config file and edit the route prefix and middleware entries there. Setting a non-guessable prefix plus auth middleware and an environment guard is the recommended baseline. Because route registration is config-driven, you can keep the package installed everywhere while only exposing the route where it is safe.
- Does laravel-log-reader need a database, migrations, or a Node build step?
- No. It is a leaf-level package that registers only a route, a controller, a config file, and a Blade/JS view, with no migrations, queue workers, or domain service bindings. That means it can be added or removed without touching application code. It also has no external service dependency, which keeps installation and rollback simple.
- What are the alternatives if I need real log aggregation, and is this package actively maintained?
- If you need search across nodes, alerting, or long-term retention, use a proper aggregator such as Sentry, Papertrail, CloudWatch, or the Laravel Telescope and Monolog ecosystem rather than a file viewer. haruncpi/laravel-log-reader is a single-maintainer project with a modest star count, so expect slower responses to new Laravel version bumps. Pin the version, test upgrades in staging, and treat it as an internal ops convenience tool rather than an observability platform.