PHPackages                             wndr/laravel-victoria-logs-tail - 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. wndr/laravel-victoria-logs-tail

ActiveLibrary

wndr/laravel-victoria-logs-tail
===============================

Tail Laravel log files and ship them to VictoriaLogs

1.0.1(3mo ago)042MITPHPPHP ^8.0

Since Jan 28Pushed 3mo agoCompare

[ Source](https://github.com/wndrdigital/victoria-logs-laravel)[ Packagist](https://packagist.org/packages/wndr/laravel-victoria-logs-tail)[ RSS](/packages/wndr-laravel-victoria-logs-tail/feed)WikiDiscussions master Synced 1mo ago

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

Laravel VictoriaLogs Tail
=========================

[](#laravel-victorialogs-tail)

Tail Laravel log files and ship them to [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/).

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

[](#installation)

```
composer require wndr/laravel-victoria-logs-tail
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=victoria-logs-tail-config
```

### Environment Variables

[](#environment-variables)

Configure the following environment variables:

```
VICTORIALOGS_ENDPOINT=http://victorialogs:9428
VICTORIALOGS_APP_NAME=my-laravel-app
```

VariableDefaultDescription`VICTORIALOGS_ENDPOINT``http://localhost:9428`Base URL of your VictoriaLogs instance`VICTORIALOGS_APP_NAME``APP_NAME` or `laravel`Application name tag for log entries`VICTORIALOGS_TIMEOUT``30`HTTP timeout in seconds`VICTORIALOGS_AUTH_USERNAME``null`Basic auth username (optional)`VICTORIALOGS_AUTH_PASSWORD``null`Basic auth password (optional)### Basic Authentication

[](#basic-authentication)

If your VictoriaLogs instance requires authentication, configure basic auth credentials:

```
VICTORIALOGS_AUTH_USERNAME=your-username
VICTORIALOGS_AUTH_PASSWORD=your-password
```

Leave `VICTORIALOGS_AUTH_USERNAME` empty to disable basic auth.

### Extra Fields

[](#extra-fields)

You can add extra fields to every log entry by editing the published config file:

```
// config/victoria-logs-tail.php
'extra_fields' => [
    'environment' => env('APP_ENV'),
    'hostname' => gethostname(),
    'version' => config('app.version'),
],
```

Usage
-----

[](#usage)

Run the command to start shipping logs:

```
php artisan victorialogs:ship-logs
```

### Options

[](#options)

OptionDefaultDescription`--dir``storage/logs`Directory to watch for log files`--pattern``*.log`File pattern to match`--app`Config valueApplication name`--endpoint`Config valueVictoriaLogs endpoint`--cursor``victorialogs-cursors.json`Cursor file (only used when cleanup is disabled)`--flush-seconds``60`Flush interval in seconds`--max-bytes``900000`Max batch bytes per stream before flush`--refresh-seconds``120`How often to rescan directory for new files`--sleep-ms``200`Loop sleep when idle (milliseconds)`--cleanup-after-ship``true`Truncate shipped files and delete old rotated logs### Running as a Service

[](#running-as-a-service)

For production, run the command as a supervised service. Example using Supervisor:

```
[program:victorialogs-tail]
command=php /path/to/artisan victorialogs:ship-logs
directory=/path/to/your/app
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/log/victorialogs-tail.log
```

### Running in Docker

[](#running-in-docker)

Add to your Docker Compose:

```
services:
  victorialogs-tail:
    image: your-laravel-image
    command: php artisan victorialogs:ship-logs
    volumes:
      - ./storage/logs:/app/storage/logs
    environment:
      - VICTORIALOGS_ENDPOINT=http://victorialogs:9428
      - VICTORIALOGS_APP_NAME=my-app
      # Optional: basic auth
      # - VICTORIALOGS_AUTH_USERNAME=user
      # - VICTORIALOGS_AUTH_PASSWORD=secret
    depends_on:
      - victorialogs
```

Log Format
----------

[](#log-format)

Logs are shipped to VictoriaLogs in JSON Lines format with the following fields:

FieldDescription`_msg`The log message content`_time`Timestamp in milliseconds`app`Application name`stream`Log file name (e.g., `laravel.log`)+ any extra fieldsCustom fields from configQuerying Logs
-------------

[](#querying-logs)

Once shipped, query your logs using VictoriaLogs' LogsQL:

```
# All logs from your app
curl 'http://victorialogs:9428/select/logsql/query' -d 'query=app:"my-laravel-app"'

# Error logs only
curl 'http://victorialogs:9428/select/logsql/query' -d 'query=app:"my-laravel-app" AND _msg:~"error"'

# Logs from a specific stream
curl 'http://victorialogs:9428/select/logsql/query' -d 'query=app:"my-laravel-app" AND stream:"laravel.log"'
```

Features
--------

[](#features)

- **Multi-line log support**: Automatically groups stack traces and multi-line log entries
- **Log rotation handling**: Detects file rotation and truncation
- **Batched shipping**: Groups log entries for efficient HTTP transport
- **Graceful shutdown**: Flushes all pending logs on SIGTERM/SIGINT
- **Automatic cleanup**: Optionally truncates shipped files and deletes old rotated logs
- **Cursor persistence**: Tracks read position to resume after restarts (when cleanup is disabled)
- **Basic authentication**: Optional HTTP basic auth for secured VictoriaLogs instances

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance80

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

2

Last Release

104d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e05f0077d10f9ef66e3e5326a9944dd94b6266de8c219da5117b959fb28a654?d=identicon)[wndr](/maintainers/wndr)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/wndr-laravel-victoria-logs-tail/health.svg)

```
[![Health](https://phpackages.com/badges/wndr-laravel-victoria-logs-tail/health.svg)](https://phpackages.com/packages/wndr-laravel-victoria-logs-tail)
```

###  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/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)

PHPackages © 2026

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