PHPackages                             plusinfolab/logstation - 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. plusinfolab/logstation

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

plusinfolab/logstation
======================

An elegant log management assistant for Laravel applications - search, filter, export and monitor logs in real-time with a beautiful UI

1.0.0(5mo ago)042[3 PRs](https://github.com/plusinfolab/logstation/pulls)MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Dec 4Pushed 1mo agoCompare

[ Source](https://github.com/plusinfolab/logstation)[ Packagist](https://packagist.org/packages/plusinfolab/logstation)[ Docs](https://github.com/plusinfolab/logstation)[ GitHub Sponsors](https://github.com/plusinfolab)[ RSS](/packages/plusinfolab-logstation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (15)Versions (5)Used By (0)

LogStation
==========

[](#logstation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9929df2432754aadc1463814cbf330ab3f57bca5be73d07336160c2b9e66ac32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706c7573696e666f6c61622f6c6f6773746174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/plusinfolab/logstation)[![Total Downloads](https://camo.githubusercontent.com/726a1b5d8530130828c8181edf12a2df60fdab51a739889c9267c2cd3d105643/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706c7573696e666f6c61622f6c6f6773746174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/plusinfolab/logstation)

An elegant log management assistant for Laravel applications. Search, filter, export and monitor logs in real-time with a beautiful, Telescope-inspired UI.

Features
--------

[](#features)

- 🔍 **Advanced Search &amp; Filtering** - Search logs by message, level, channel, date range, tags, and user
- 📤 **Export Logs** - Export to JSON, CSV, or TXT formats
- 📋 **Saved Snippets** - Save and reuse complex search filters
- 🔐 **Authorization Gates** - Customizable access control
- ⚡ **Real-time Viewing** - See logs appear instantly (with broadcasting)
- 🎨 **Beautiful UI** - Telescope-inspired interface built with Vue 3 and Tailwind CSS
- 💾 **Flexible Storage** - Database or file-based storage
- 🏷️ **Auto-tagging** - Automatic tagging by user, request, session, and IP
- 🔥 **Exception Tracking** - Full stack traces and exception details
- 📊 **Statistics Dashboard** - Overview of logs by level, channel, and time period

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

[](#installation)

Install the package via composer:

```
composer require plusinfolab/logstation
```

Run the installation command:

```
php artisan logstation:install
```

This will:

- Publish the configuration file
- Publish and run migrations
- Publish frontend assets

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=logstation-config
```

The config file allows you to customize:

- Storage driver (database or file)
- Database connection
- Data retention
- Watchers (log, exception, query)
- Authorization
- Real-time broadcasting
- And more...

### Authorization

[](#authorization)

By default, LogStation is only accessible in the `local` environment. To customize who can access LogStation, publish the config file and modify the `authorization.callback`:

```
// config/logstation.php

'authorization' => [
    'callback' => function ($request) {
        // Example 1: Allow specific users
        return in_array($request->user()?->email, [
            'admin@example.com',
            'developer@example.com',
        ]);

        // Example 2: Use Laravel Gate
        return Gate::allows('viewLogstation', $request->user());

        // Example 3: Check user role
        return $request->user()?->hasRole('admin');

        // Example 4: Environment-based
        return app()->environment(['local', 'staging']);
    },
],
```

You can also define a Gate in your `AuthServiceProvider`:

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

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

Or use a Policy:

```
php artisan make:policy LogStationPolicy
```

```
// app/Policies/LogStationPolicy.php
public function view(?User $user): bool
{
    return $user && $user->isAdmin();
}
```

### Enable/Disable

[](#enabledisable)

```
'enabled' => env('LOGSTATION_ENABLED', !app()->environment('production')),
```

### Storage Driver

[](#storage-driver)

Choose between `database` (default) or `file`:

```
'driver' => env('LOGSTATION_DRIVER', 'database'),
```

### Database Connection

[](#database-connection)

Use a separate database connection (recommended):

```
'database' => [
    'connection' => env('LOGSTATION_DB_CONNECTION', config('database.default')),
],
```

In your `.env`:

```
LOGSTATION_DB_CONNECTION=logstation
```

Then add the connection in `config/database.php`:

```
'connections' => [
    'logstation' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'database' => 'logstation',
        'username' => env('DB_USERNAME'),
        'password' => env('DB_PASSWORD'),
        // ... other settings
    ],
],
```

### Data Retention

[](#data-retention)

Configure how long to keep logs:

```
'retention' => [
    'days' => env('LOGSTATION_RETENTION_DAYS', 7),
],
```

### Watchers

[](#watchers)

Enable/disable specific watchers:

```
'watchers' => [
    PlusinfoLab\Logstation\Watchers\LogWatcher::class => [
        'enabled' => true,
        'channels' => ['stack', 'single', 'daily'],
        'levels' => ['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'],
    ],
    PlusinfoLab\Logstation\Watchers\ExceptionWatcher::class => [
        'enabled' => true,
    ],
    PlusinfoLab\Logstation\Watchers\QueryWatcher::class => [
        'enabled' => false,
        'slow' => 100, // Log queries slower than 100ms
    ],
],
```

### Authorization

[](#authorization-1)

Customize who can access LogStation:

```
'authorization' => [
    'callback' => function ($request) {
        return app()->environment('local') ||
               $request->user()?->email === env('LOGSTATION_ADMIN_EMAIL');
    },
],
```

Or use a Gate:

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

### Real-time Broadcasting

[](#real-time-broadcasting)

Enable real-time log updates:

```
'broadcasting' => [
    'enabled' => env('LOGSTATION_BROADCASTING', false),
    'channel' => 'logstation',
],
```

Usage
-----

[](#usage)

### Accessing the Dashboard

[](#accessing-the-dashboard)

Visit `/logstation` in your browser (configurable via `LOGSTATION_PATH`).

### Programmatic Usage

[](#programmatic-usage)

```
use PlusinfoLab\Logstation\Facades\Logstation;

// Record a log entry
Logstation::recordLog([
    'level_name' => 'error',
    'message' => 'Something went wrong',
    'context' => ['user_id' => 123],
]);

// Search logs
$logs = Logstation::search([
    'level' => 'error',
    'start_date' => now()->subDays(7),
    'search' => 'payment',
], perPage: 50);

// Get statistics
$stats = Logstation::getStatistics();

// Find specific entry
$entry = Logstation::find($id);

// Delete entry
Logstation::delete($id);
```

### Artisan Commands

[](#artisan-commands)

```
# Install LogStation
php artisan logstation:install

# Prune old entries (based on retention config)
php artisan logstation:prune

# Prune entries older than specific days
php artisan logstation:prune --days=30

# Clear all entries
php artisan logstation:clear

# Publish assets
php artisan logstation:publish
```

Schedule automatic pruning in `app/Console/Kernel.php`:

```
protected function schedule(Schedule $schedule)
{
    $schedule->command('logstation:prune')->daily();
}
```

Search &amp; Filtering
----------------------

[](#search--filtering)

LogStation provides powerful filtering capabilities:

- **By Level**: Filter by log level (emergency, alert, critical, error, warning, notice, info, debug)
- **By Channel**: Filter by log channel
- **By Date Range**: Filter logs within a specific date range
- **By User**: Filter logs by authenticated user
- **By Tag**: Filter by auto-generated or custom tags
- **Full-text Search**: Search in message, exception message, and context

### Creating Snippets

[](#creating-snippets)

Save frequently used filters as snippets:

1. Apply your desired filters in the UI
2. Click "Save as Snippet"
3. Give it a name and description
4. Reuse anytime from the Snippets menu

Exporting Logs
--------------

[](#exporting-logs)

Export filtered logs in multiple formats:

1. Apply your filters
2. Click "Export"
3. Choose format (JSON, CSV, TXT)
4. Download the file

Exports are limited to 10,000 entries by default (configurable).

Performance Considerations
--------------------------

[](#performance-considerations)

### Use a Separate Database

[](#use-a-separate-database)

For production applications, use a dedicated database connection:

```
LOGSTATION_DB_CONNECTION=logstation
```

This prevents LogStation from impacting your main application's performance.

### Disable in Production

[](#disable-in-production)

By default, LogStation is disabled in production. Enable only when needed:

```
LOGSTATION_ENABLED=true
```

### Regular Pruning

[](#regular-pruning)

Schedule the prune command to run daily:

```
$schedule->command('logstation:prune')->daily();
```

### Disable Unnecessary Watchers

[](#disable-unnecessary-watchers)

Disable watchers you don't need:

```
'watchers' => [
    PlusinfoLab\Logstation\Watchers\QueryWatcher::class => [
        'enabled' => false, // Disable query watcher
    ],
],
```

Frontend Development
--------------------

[](#frontend-development)

The UI is built with Vue 3, Inertia.js, and Tailwind CSS. To customize:

```
# Install dependencies
npm install

# Build for production
npm run build

# Watch for changes
npm run watch
```

Comparison with Other Tools
---------------------------

[](#comparison-with-other-tools)

FeatureLogStationLaravel TelescopeLaravel Log ViewerLog Search✅❌✅Log Export✅❌✅Saved Snippets✅❌❌Real-time Viewing✅✅❌Exception Tracking✅✅✅Database Queries✅✅❌Request Tracking✅✅❌Beautiful UI✅✅⚠️File Storage✅❌✅Security
--------

[](#security)

LogStation is designed for development and debugging. **Never expose it publicly in production** without proper authentication.

Default security measures:

- Only accessible in local environment by default
- Customizable authorization callback
- Gate-based access control
- Configurable middleware

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Aditya](https://github.com/plusinfolab)
- Inspired by [Laravel Telescope](https://github.com/laravel/telescope)
- Built with [Spatie's Laravel Package Tools](https://github.com/spatie/laravel-package-tools)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance82

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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

165d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5704ae6235da3734f84e8db1db6e2e10a1a697dfde3643939386e7ccb374a795?d=identicon)[amjpdevp](/maintainers/amjpdevp)

---

Top Contributors

[![amjpdevp](https://avatars.githubusercontent.com/u/113779419?v=4)](https://github.com/amjpdevp "amjpdevp (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelloggingmonitoringdebuglogstelescopeplusinfolablogstation

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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