spatie/laravel-tail
Composer 安装命令:
composer require spatie/laravel-tail
包简介
Easily tail application logs
README 文档
README
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
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
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
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
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
Please see CHANGELOG for more information 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
This package was created because the awesome tail command present in Laravel 4 was dropped in Laravel 5. The tail command from this package is equivalent to Laravel's old one minus the remote tailing features.
License
The MIT License (MIT). Please see License File for more information.
spatie/laravel-tail 适用场景与选型建议
spatie/laravel-tail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.61M 次下载、GitHub Stars 达 748, 最近一次更新时间为 2015 年 02 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「log」 「development」 「laravel」 「tail」 「laravel-tail」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spatie/laravel-tail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spatie/laravel-tail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spatie/laravel-tail 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Library with classes to help you do batch.
GHT D-Tools Bundle
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Laravel 5.x.x library for integration Monolog Sentry
Pacote simplificado para persistência de logs
统计信息
- 总下载量: 2.61M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 758
- 点击次数: 18
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-10