spatie / nova-tail-tool
A Laravel Nova tool to display the application log.
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/support: ^13.0
- laravel/nova: ^5.11.1
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Have you always wanted to see your application log in your Nova app? Now you can!
You can see the tool in action in this video on YouTube.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
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. We publish all received postcards on our virtual postcard wall.
Installation
Version 4 requires PHP 8.4+, Laravel 13, and Nova 5.11.1+. Older PHP, Laravel, and Nova versions are no longer supported. See UPGRADING when upgrading from version 3.
Install the tool in a Laravel application with Nova already installed and authenticated:
composer require spatie/nova-tail-tool:^4.0
Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.
// in app/Providers/NovaServiceProvider.php // ... public function tools(): array { return [ // ... new \Spatie\TailTool\TailTool(), ]; }
Usage
Click "Application log" in Nova's menu. The tool listens for entries appended after you open the page, polling once per second. It reads the most recently modified .log file in storage/logs, including daily logs. Log rotation and truncation reset the cursor. Logs sent only to stderr or a remote service cannot be displayed.
Entries are displayed as plain text, including HTML. The browser keeps the latest 500,000 characters. Scrolling up stops automatic scrolling; "Scroll to bottom" resumes it. Failed requests show a connection message and retry automatically. Leaving the page stops polling.
Logs can contain sensitive information. Restrict access using Nova's canSee callback on the registered tool. The page and polling endpoint both enforce this callback and Nova authentication and authorization:
(new \Spatie\TailTool\TailTool) ->canSee(fn ($request) => $request->user()->can('viewApplicationLogs')),
The page is available at /nova/application-log, or under your configured Nova path.
Testing
composer test
The test suite uses Pest 5 and the real Nova package. Configure Composer's Nova repository credentials before running composer update. CI requires two repository or organization secrets:
NOVA_USERNAME: the Nova account email address.NOVA_LICENSE_KEY: a license key entitled to download Nova 5.11.1.
The workflow configures Composer authentication from these secrets. No JSON secret is needed.
Building assets
npm ci npm run build
Commit the rebuilt dist files. Applications using the package do not need Node.js. The Vue 3 components use Nova's own Vue runtime, with Vite replacing Laravel Mix.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
