PHPackages                             willypelz/laravel-log-platform - 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. willypelz/laravel-log-platform

ActiveLibrary

willypelz/laravel-log-platform
==============================

Production-grade logging and monitoring platform for Laravel applications

v1.8.0(1mo ago)017↓100%MITPHPPHP ^8.1|^8.2|^8.3CI passing

Since Mar 19Pushed 1mo agoCompare

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

READMEChangelogDependencies (9)Versions (10)Used By (0)

Laravel Log Platform
====================

[](#laravel-log-platform)

A production-grade logging and monitoring platform for Laravel applications that extends Monolog with custom log generation strategies, high-performance indexing, real-time streaming, and advanced analytics.

Features
--------

[](#features)

### 🚀 Core Features

[](#-core-features)

- **Custom Log Generation Strategies**: Configure daily, weekly, monthly, or custom naming patterns
- **High-Performance Indexing**: Chunked reading, lazy loading, and background indexing for GB-scale logs
- **Fast Modern UI**: Beautiful, responsive SPA with virtual scrolling and dark mode
- **Advanced Filtering**: Search by level, date range, keywords, and structured queries
- **Real-Time Streaming**: Live log updates using Server-Sent Events
- **Request Correlation**: Track all logs for a single request with unique IDs
- **Alerting System**: Trigger notifications based on error thresholds and patterns
- **Metrics Dashboard**: Visualize errors per minute, request latency, and trends
- **Multi-Environment Support**: Manage logs from local, staging, and production

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

[](#installation)

```
composer require willypelz/laravel-log-platform
```

### Interactive Installation

[](#interactive-installation)

Run the install command and choose your mode:

```
php artisan log:install
```

You'll be asked: **"Do you want to use database indexing?"**

- **Yes** - Full features (recommended for production)
- **No** - Simple file-only mode (no migrations)
- **Decide later** - Configure manually

### Manual Installation

[](#manual-installation)

Publish the config file:

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

**For Database Mode** (optional):

```
php artisan vendor:publish --tag=log-platform-migrations
php artisan migrate
```

**For File-Only Mode:**

```
// config/log-platform.php
'indexing' => ['enabled' => false],
```

See [CHOOSING\_YOUR\_MODE.md](docs/CHOOSING_YOUR_MODE.md) for detailed comparison.

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

[](#configuration)

Edit `config/log-platform.php` to customize:

```
return [
    'default_strategy' => 'daily', // daily, weekly, monthly, or custom
    'indexing' => [
        'enabled' => true,
        'chunk_size' => 65536, // 64KB
        'queue' => 'default',
    ],
    'streaming' => [
        'enabled' => true,
        'driver' => 'sse', // sse or websocket
    ],
    'alerts' => [
        'enabled' => true,
        'channels' => ['mail', 'slack'],
    ],
];
```

### Configure Custom Log Strategy

[](#configure-custom-log-strategy)

In your `config/logging.php`, add the custom handler:

```
'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['custom-daily'],
    ],

    'custom-daily' => [
        'driver' => 'custom',
        'via' => \Willypelz\LogPlatform\Handlers\StrategyRotatingFileHandler::class,
        'path' => storage_path('logs'),
        'level' => 'debug',
        'strategy' => 'daily', // or 'weekly', 'monthly', 'custom'
    ],
],
```

Usage
-----

[](#usage)

### Index Logs

[](#index-logs)

```
# Index all logs
php artisan log:index

# Index specific environment
php artisan log:index --env=production

# Rebuild index from scratch
php artisan log:index --rebuild

# Index from specific date
php artisan log:index --from=2026-03-01
```

### View Statistics

[](#view-statistics)

```
php artisan log:stats
```

### Clear Old Logs

[](#clear-old-logs)

```
# Clear logs older than 30 days
php artisan log:clear --days=30

# Clear specific level
php artisan log:clear --level=debug
```

### Access Web UI

[](#access-web-ui)

Navigate to: `http://your-app.com/log-platform`

API Endpoints
-------------

[](#api-endpoints)

All endpoints are prefixed with `/log-platform/api`:

- `GET /logs` - List logs with filters
- `GET /logs/{id}` - Get single log entry
- `GET /logs/stream` - Real-time log streaming (SSE)
- `GET /requests/{request_id}/logs` - Get all logs for a request
- `GET /metrics/overview` - Get metrics overview
- `GET /metrics/timeseries` - Get time-series data
- `GET /alerts/rules` - List alert rules
- `POST /alerts/rules` - Create alert rule
- `POST /index/sync` - Trigger manual index sync

Advanced Usage
--------------

[](#advanced-usage)

### Structured Queries

[](#structured-queries)

Use structured query syntax for advanced filtering:

```
level:error AND user_id:123
level:error OR level:critical
message:"Database connection failed"
NOT level:debug
(level:error OR level:critical) AND env:production

```

### Custom Naming Strategy

[](#custom-naming-strategy)

Create a custom strategy class:

```
use Willypelz\LogPlatform\Contracts\NamingStrategyInterface;

class CustomNamingStrategy implements NamingStrategyInterface
{
    public function resolveFilename(\DateTimeInterface $date, string $channel): string
    {
        return sprintf(
            'laravel-%s-%s.log',
            $channel,
            $date->format('Y-m-d-H')
        );
    }
}
```

Register in config:

```
'strategies' => [
    'custom' => CustomNamingStrategy::class,
],
```

Architecture
------------

[](#architecture)

- **Write Path**: Custom Monolog handlers with processors
- **Index Path**: Async tail-based parser with checkpointing
- **Query Path**: Indexed DB search with file fallback
- **Stream Path**: SSE/WebSocket broadcaster
- **Alert Path**: Rule engine with notification channels
- **Metrics Path**: Aggregate rollups for dashboards

Performance
-----------

[](#performance)

- Handles GB-scale log files
- Chunked reading (never loads entire files)
- Background queue processing
- Virtual scrolling for millions of entries
- Sub-second query response times

Security
--------

[](#security)

Configure middleware in `config/log-platform.php`:

```
'security' => [
    'middleware' => ['web', 'auth', 'can:view-logs'],
    'allowed_environments' => ['local', 'staging', 'production'],
],
```

License
-------

[](#license)

MIT License

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance89

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

9

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a31328ff75e69b28bb18cc555f08e3908b347665541e8d4678328233f7ad43b?d=identicon)[willypelz](/maintainers/willypelz)

---

Top Contributors

[![willypelz](https://avatars.githubusercontent.com/u/23083380?v=4)](https://github.com/willypelz "willypelz (10 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/willypelz-laravel-log-platform/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[laravel/pennant

A simple, lightweight library for managing feature flags.

57311.1M53](/packages/laravel-pennant)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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