devdot/log-artisan

View and manage log files using the artisan CLI

v2.4 2024-05-02 16:17 UTC

This package is auto-updated.

Last update: 2024-11-02 17:16:15 UTC


README

Access laravel logs through the Artisan Console.

This package is using devdot/monolog-parser to parse logfiles that were created by Laravel.

Installation

Add the package to your Laravel application:

composer require devdot/log-artisan

Basic Usage

Take a look at the last few log entries using the console:

php artisan log:show

Example result:

log-show

Show the results in a compressed single line view using --singleline or -s:

log-show-singleline

Search through logs using log:search, with search terms that can be regex:

log-search

Clear all log files like this:

php artisan log:clear

Documentation

About Command

View details about the current logging configuration and status:

php artisan log:about

Show Command

Show entries from the logs (this will merge all logfiles and sort by date).

php artisan log:show

Use these options to narrow the results:

Example (show full logged stacktraces for the latest 100 log entries with level DEBUG):

php artisan log:show -c100 --level=DEBUG --stacktrace

Search Command

Search through the results with a given search term. The search term is treated as PHP regular expression, so make sure to escape any special characters like . or *.

php artisan log:search test
php artisan log:search "(test|regex \w+)"

Options are the same as with log:show.

Clear Command

Clear a given logging channel. Use option --all to clear all configured channels.

php artisan log:clear single
php artisan log:clear --all

This command will write a new log entry to each cleared file.