PHPackages                             logscope/logscope - 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. logscope/logscope

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

logscope/logscope
=================

View, search, filter, and correlate Laravel application logs through a web UI and JSON API.

v0.2.0(1mo ago)03↓50%MITPHPPHP ^8.2

Since Jun 12Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

LogScope
========

[](#logscope)

View, search, and filter your Laravel application logs through a fast Vue dashboard and a JSON API — without ever loading a multi-gigabyte file into memory.

[![LogScope dashboard](https://raw.githubusercontent.com/contrib-utils/laravel-log-stream/main/art/screenshot.jpeg)](https://raw.githubusercontent.com/contrib-utils/laravel-log-stream/main/art/screenshot.jpeg)

> **Status:** Milestones 1–5 complete. Log discovery, byte-offset tailing, parsers for Laravel/Monolog plus nginx, Apache, Redis, PostgreSQL, supervisor and a generic fallback, the entries + search API, gated file operations (download / clear / delete), and the full SPA (list, detail, level filter, single-file and cross-file search, live tail, deep links, session login/logout) are all in place. Execution correlation and mail previews are planned for later milestones.

Features
--------

[](#features)

- **Reads huge logs cheaply.** A byte-offset reader pages newest-first and tails in `O(window)`, never `O(file)`, so rotated multi-GB logs open instantly.
- **Many log formats.** A first-class Laravel/Monolog parser (line format, multi-line stack traces, trailing JSON context/extra, and the JSON formatter), plus parsers for **nginx**, **Apache**, **Redis**, **PostgreSQL**, and **supervisor**, and a **generic** fallback. Malformed lines are surfaced, never dropped.
- **Level filtering** across the eight PSR-3 levels (plus `unknown`), with per-level counts on the loaded view. Source-specific severity tokens (nginx `emerg`, Postgres `LOG`, supervisor `ERRO`, …) are normalised via configurable aliases.
- **Search.** Substring search within a file, or **cross-file search** across every (rotated) file in a source, with a composite cursor that pages seamlessly across file boundaries.
- **Live tail.** Toggle live mode to follow a file; new entries arrive inline when you're at the top, or stack behind a "N new entries" pill when you've scrolled away.
- **Deep links.** Every entry has a permalink. Opening it lands in the SPA with the entry pinned above the stream and its file selected for context.
- **File operations.** Download, clear, or delete a log file from the sidebar — all behind the `allow_file_operations` master switch (off → the endpoints return 403) and a confirmation step for destructive actions.
- **Polished UI.** Light/dark theme, responsive layout, keyboard shortcuts, accessible controls, and reduced-motion support.
- **Secure by default.** An access gate protects the dashboard and API, with a session login/logout flow; opaque file ids are re-validated through a path-traversal guard on every read.

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

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

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

[](#installation)

The package is developed inside this repo via a Composer **path repository** (see the root `composer.json`). In a real consuming app you would instead:

```
composer require logscope/logscope
php artisan logscope:install
```

`logscope:install` publishes the config and the compiled assets, and prints the env keys to set.

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

[](#configuration)

Set credentials to protect the dashboard:

```
LOGSCOPE_AUTH_USER=admin
LOGSCOPE_AUTH_PASSWORD=change-me
```

Then visit `/logscope`.

- In **local** environments with no credentials set, the dashboard is open for convenience.
- In **any other** environment, missing credentials lock the dashboard down (403) — it is never silently open.

Publish `config/logscope.php` to customise the route prefix, the access middleware, log **sources** (glob patterns + parser), level labels/colours and aliases, and the live-tail poll interval (`LOGSCOPE_POLL_MS`, default 3000ms).

Beyond `laravel`, the config ships sources for `horizon`, `nginx`, `apache`, `redis`, `postgres`, `supervisor`, and `php-fpm` — all **disabled by default**, since their log locations vary by host. Enable the ones you have (set `enabled => true` and adjust `paths`). Available `parser` values: `laravel`, `nginx`, `apache`, `redis`, `postgres`, `supervisor`, `generic`.

### Custom authorization (production path)

[](#custom-authorization-production-path)

Register a callback from a service provider's `boot()` — it takes precedence over the env credentials:

```
use LogScope\Facades\LogScope;

LogScope::auth(fn (\Illuminate\Http\Request $r) => $r->user()?->isAdmin() === true);
```

Or point `config('logscope.authorization.using')` at an invokable class.

JSON API
--------

[](#json-api)

All endpoints sit under the configured prefix (`/logscope` by default) and require access. Responses are `{ "data": [...], "meta": { "next_cursor": ... } }`; pass the returned `next_cursor` back as `?cursor=` to page.

MethodEndpointDescription`GET``/api/sources`Enabled log sources.`GET``/api/files?source=`Files for a source, newest first.`GET``/api/files/{fileId}/entries`Entries for a file. Params: `cursor`, `per_page`, `direction` (`backward`|`forward`), `level` (comma-separated), `q`.`GET``/api/search?source=&q=`Cross-file search within a source. Params: `cursor`, `per_page`, `level`.`GET``/api/entries/{entryId}`A single entry, for share / deep links.`GET``/api/files/{fileId}/download`Download the raw log file. †`POST``/api/files/{fileId}/clear`Truncate the file in place. †`DELETE``/api/files/{fileId}`Delete the file from disk. †† File operations require `allow_file_operations` to be enabled (`LOGSCOPE_ALLOW_FILE_OPS`, default on); they respond 403 otherwise. State-changing calls run under the `web` middleware, so they require a valid CSRF token / session.

Keyboard shortcuts
------------------

[](#keyboard-shortcuts)

KeyAction`/`Focus search`r`Refresh`l`Toggle live tail`Esc`Clear / blur searchDeveloping the SPA
------------------

[](#developing-the-spa)

```
cd packages/logscope
npm install
npm run build          # compiles to resources/dist
php artisan vendor:publish --tag=logscope-assets --force   # from the app root
```

Testing
-------

[](#testing)

```
cd packages/logscope
composer install
vendor/bin/phpunit
```

Credits
-------

[](#credits)

Created and maintained by [Heinrich Smith Ondeyo](https://github.com/Heinirich).

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

Every ~0 days

Total

2

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a6cc3a9352abe5ea213d1ca88808acbe0bb07699592cbd285974e0bda46fb47?d=identicon)[Heinirich](/maintainers/Heinirich)

---

Top Contributors

[![Heinirich](https://avatars.githubusercontent.com/u/69395330?v=4)](https://github.com/Heinirich "Heinirich (9 commits)")

---

Tags

laravelmonitoringdebugginglogslog viewer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/logscope-logscope/health.svg)

```
[![Health](https://phpackages.com/badges/logscope-logscope/health.svg)](https://phpackages.com/packages/logscope-logscope)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k30.2M151](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M137](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k21](/packages/fleetbase-core-api)

PHPackages © 2026

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