PHPackages                             netojose/laravel-log-viewer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. netojose/laravel-log-viewer

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

netojose/laravel-log-viewer
===========================

A Laravel package for viewing and managing application log files.

1.0(1mo ago)077MITBladePHP ^8.2

Since Apr 15Pushed 1mo agoCompare

[ Source](https://github.com/netojose/laravel-log-viewer)[ Packagist](https://packagist.org/packages/netojose/laravel-log-viewer)[ RSS](/packages/netojose-laravel-log-viewer/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

netojose/laravel-log-viewer
===========================

[](#netojoselaravel-log-viewer)

A Laravel 11+ package for viewing, filtering, downloading and clearing application log files — directly in the browser.

[![image](./_screenshots/screenshot.png)](./_screenshots/screenshot.png)

Features
--------

[](#features)

- View and parse `storage/logs/laravel.log` (and additional log files)
- Filter entries by log level (EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG)
- Pagination for large log files
- Download any log file
- Clear (truncate) any log file
- Route protection via Laravel Gate
- Pure HTML/CSS UI — zero JavaScript/CSS framework dependencies
- Publishable config and views

---

Requirements
------------

[](#requirements)

- PHP `^8.2`
- Laravel `^11.0 || ^12.0 || ^13.0`

---

Installation
------------

[](#installation)

```
composer require netojose/laravel-log-viewer
```

The service provider is registered automatically via Laravel's package auto-discovery.

### Publish the config (optional)

[](#publish-the-config-optional)

```
php artisan vendor:publish --tag=log-viewer-config
```

This copies `config/log-viewer.php` to your application's config directory.

### Publish the views (optional)

[](#publish-the-views-optional)

```
php artisan vendor:publish --tag=log-viewer-views
```

---

Usage
-----

[](#usage)

After installation, visit:

```
http://your-app.test/log-viewer

```

---

Configuration
-------------

[](#configuration)

```
// config/log-viewer.php

return [

    // Enable or disable the log viewer entirely
    'enabled' => env('LOG_VIEWER_ENABLED', true),

    // URL prefix for all routes
    'prefix' => env('LOG_VIEWER_PREFIX', 'log-viewer'),

    // Middleware applied to all routes (authorization middleware is appended automatically)
    'middleware' => ['web'],

    // Gate name used for authorization (set to null to disable)
    'gate' => 'viewLogViewer',

    // Extra log files to expose (storage/logs/laravel.log is always included)
    'logs' => [
        // 'Worker'    => storage_path('logs/worker.log'),
        // 'Scheduler' => storage_path('logs/scheduler.log'),
    ],

    // Entries per page
    'per_page' => env('LOG_VIEWER_PER_PAGE', 50),

];
```

---

Authorization
-------------

[](#authorization)

By default, the `viewLogViewer` gate allows access **only in the `local` environment**. In any other environment (staging, production) access is denied with a 403.

To customize access, define the gate in your `AppServiceProvider` (or any service provider):

```
use Illuminate\Support\Facades\Gate;

public function boot(): void
{
    Gate::define('viewLogViewer', function ($user) {
        return in_array($user->email, [
            'admin@example.com',
        ]);
    });
}
```

To allow access for guests (unauthenticated users), accept a nullable user:

```
Gate::define('viewLogViewer', function (?User $user) {
    // custom logic
    return true;
});
```

To **disable** gate checks entirely, set `'gate' => null` in your config.

---

Adding extra log files
----------------------

[](#adding-extra-log-files)

Any entry in the `logs` config key becomes available in the log viewer:

```
'logs' => [
    'Worker'    => storage_path('logs/worker.log'),
    'Scheduler' => storage_path('logs/scheduler.log'),
    'Nginx'     => '/var/log/nginx/error.log',
],
```

> **Security note:** Only files explicitly listed in the config can be accessed. User input is never used to derive file paths.

---

Available Routes
----------------

[](#available-routes)

MethodURINameDescriptionGET`/log-viewer``log-viewer.index`List all log filesGET`/log-viewer/{file}``log-viewer.show`View log entries (`?level=ERROR&page=2`)GET`/log-viewer/{file}/download``log-viewer.download`Download log fileDELETE`/log-viewer/{file}``log-viewer.destroy`Clear (truncate) log file---

Disabling the package
---------------------

[](#disabling-the-package)

Set the environment variable:

```
LOG_VIEWER_ENABLED=false
```

Routes will not be registered and the viewer will return 404.

---

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/134008?v=4)[José Neto](/maintainers/netojose)[@netojose](https://github.com/netojose)

---

Top Contributors

[![netojose](https://avatars.githubusercontent.com/u/134008?v=4)](https://github.com/netojose "netojose (1 commits)")

---

Tags

loglaravellogslog viewer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/netojose-laravel-log-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/netojose-laravel-log-viewer/health.svg)](https://phpackages.com/packages/netojose-laravel-log-viewer)
```

###  Alternatives

[arcanedev/log-viewer

Provides a Log Viewer for Laravel

2.4k6.9M54](/packages/arcanedev-log-viewer)[jackiedo/log-reader

An easy log reader and management tool for Laravel

151418.3k4](/packages/jackiedo-log-reader)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14844.4k1](/packages/guanguans-laravel-exception-notify)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.6k1](/packages/melihovv-laravel-log-viewer)[kssadi/log-tracker

A powerful, intuitive, and efficient log viewer for Laravel applications.

275.9k](/packages/kssadi-log-tracker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
