devdot/log-artisan 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devdot/log-artisan

最新稳定版本:v2.5

Composer 安装命令:

composer require devdot/log-artisan

包简介

View and manage log files using the artisan CLI

README 文档

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:

Option Name Description
-c, --count Count Show this amount of entries, default is 10
-l, --level Log Level Show only entries with this log level
--channel Log Channel Use this specified logging channel
--short Short view Only show short snippets
-s, --singleline Single-line view Show single-lined layout
--stacktrace Stacktrace view Show the full stacktrace

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.

统计信息

  • 总下载量: 395
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-13