PHPackages                             spatie/laravel-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. spatie/laravel-tail

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

spatie/laravel-tail
===================

Easily tail application logs

4.6.0(2mo ago)7592.5M—2.1%454MITPHPPHP ^8.0CI passing

Since Feb 10Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/spatie/laravel-tail)[ Packagist](https://packagist.org/packages/spatie/laravel-tail)[ Docs](https://github.com/spatie/laravel-tail)[ Fund](https://spatie.be/open-source/support-us)[ RSS](/packages/spatie-laravel-tail/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (44)Used By (4)

Easily tail your logs
=====================

[](#easily-tail-your-logs)

[![Latest Version](https://camo.githubusercontent.com/bc52f743a98e59b0e926991dc65d4565b45fdc650ff21030e9b0e17cd794c7e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7370617469652f6c61726176656c2d7461696c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-tail/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/098c83201f2d25e528ca0ebb7f086df8f589572a41a09cf60673261ac52872af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d7461696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-tail)

This package offers an artisan command to tail the application log. It supports daily and single logs on your local machine.

To tail the log you can use this command:

```
php artisan tail
```

It can also tail logs on other environments:

```
php artisan tail production
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/8207d911c31e3b5113f5c137c5c3dfae80b5df80fee5d99c4810d78963445802/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d7461696c2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-tail)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require spatie/laravel-tail
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Spatie\Tail\TailServiceProvider"
```

This is the contents of the file that will be published at `config/tail.php`:

```
return [
    'production' => [

        /*
         * The host that contains your logs.
         */
        'host' => env('TAIL_HOST_PRODUCTION', ''),

        /*
         * The user to be used to SSH to the server.
         */
        'user' => env('TAIL_USER_PRODUCTION', ''),

        /*
         * The path to the directory that contains your logs.
         */
        'log_directory' => env('TAIL_LOG_DIRECTORY_PRODUCTION', ''),

        /*
         * The filename of the log file that you want to tail.
         * Leave null to let the package automatically select the file.
         */
        'file' => env('TAIL_LOG_FILE_PRODUCTION', null),

    ],
];
```

Usage
-----

[](#usage)

To tail the local log you can use this command:

```
php artisan tail
```

You can start the output with displaying the last lines in the log by using the `lines`-option.

```
php artisan tail --lines=50
```

By default, the most-recently modified file in the directory will be used. You can specify the file that you would like to tail by using the `file` option.

```
php artisan tail --file="other-file.log"
```

It's also possible to fully clear the output buffer after each log item. This can be useful if you're only interested in the last log entry when debugging.

```
php artisan tail --clear
```

Should you wish to filter the log to return only certain keywords then you can also use the grep feature.

```
php artisan tail --grep="only display lines that contain this string"
```

### Tailing remote logs

[](#tailing-remote-logs)

To tail remote logs, you must first specify values for `host`, `user`, `log_directory`, and `file` keys of an environment in the `tail` config file.

After that you can tail that logs of an environment like this

```
php artisan tail production
```

You can also use the `--clear`, `--file`, and `--lines` options described above.

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

This package was created because [the awesome tail command present in Laravel 4](https://github.com/laravel/framework/blob/4.2/src/Illuminate/Foundation/Console/TailCommand.php) was dropped in Laravel 5. The tail command from this package is equivalent to Laravel's old one minus the remote tailing features.

License
-------

[](#license)

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

###  Health Score

69

—

FairBetter than 100% of packages

Maintenance83

Actively maintained with recent releases

Popularity63

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 73.9% 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 ~98 days

Recently: every ~280 days

Total

42

Last Release

86d ago

Major Versions

v1.x-dev → 2.0.02017-08-30

2.0.1 → 3.0.02018-02-07

3.3.0 → 4.0.02020-02-14

PHP version history (6 changes)1.0.0PHP &gt;=5.4.0

1.1.3PHP &gt;=5.6.0

2.0.0PHP ^7.0

4.0.0PHP ^7.4

4.3.1PHP ^7.4|^8.0

4.3.4PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (184 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (9 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (9 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (7 commits)")[![aryehraber](https://avatars.githubusercontent.com/u/5065331?v=4)](https://github.com/aryehraber "aryehraber (6 commits)")[![squatto](https://avatars.githubusercontent.com/u/748444?v=4)](https://github.com/squatto "squatto (5 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (4 commits)")[![glorand](https://avatars.githubusercontent.com/u/883989?v=4)](https://github.com/glorand "glorand (3 commits)")[![Kyslik](https://avatars.githubusercontent.com/u/2067589?v=4)](https://github.com/Kyslik "Kyslik (3 commits)")[![jkudish](https://avatars.githubusercontent.com/u/260253?v=4)](https://github.com/jkudish "jkudish (2 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (2 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (1 commits)")[![faasie](https://avatars.githubusercontent.com/u/4673577?v=4)](https://github.com/faasie "faasie (1 commits)")[![lbausch](https://avatars.githubusercontent.com/u/5747127?v=4)](https://github.com/lbausch "lbausch (1 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (1 commits)")[![marchampson](https://avatars.githubusercontent.com/u/988694?v=4)](https://github.com/marchampson "marchampson (1 commits)")[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (1 commits)")

---

Tags

artisandebuglaravellogphptailloglaraveltaildevelopmentlaravel-tail

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spatie-laravel-tail/health.svg)

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

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[jackiedo/log-reader

An easy log reader and management tool for Laravel

151376.5k4](/packages/jackiedo-log-reader)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)

PHPackages © 2026

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