marc/epilog
Composer 安装命令:
composer require marc/epilog
包简介
Epilog is a CLI log viewer with style
README 文档
README
The lightweight, themeable and interactive PSR-3 log viewer. Monitor monologs with style:
Install
As a composer project dependency:
{
"require": {
"marc/epilog": "~1.0"
}
}
As a packed phar:
wget https://github.com/marcioAlmada/epilog/raw/master/bin/epilog && chmod +x epilog mv epilog /usr/local/bin/ # or somewhere in your $PATH
As a composer global package:
composer global require marc/epilog:~1.0
Or build the phar yourself:
# install box2 -> https://github.com/box-project/box2 git clone https://github.com/marcioAlmada/epilog.git cd epilog composer install make # phar will available at bin/ folder sudo make install # will put epilog at /usr/local/bin/ folder
Quick test
Run epilog pretend command and tail a fake log stream. Check if output looks good:
epilog pretend
Usage
Basic usage is:
epilog watch /path/to/monolog/file.log [<args>]...
While epilog is monitoring the log file (or a fake stream), hit [return] to see a nice interactive menu:
$ [ ⏎ ]
Woot! Epilog here. Please type a theme number, a valid regexp or a valid flag:
[#] load another theme:
1:chaplin 2:forest
3:scrapbook 4:punchcard
5:sunset 6:sunrise
7:traffic 8:usa
[ r ] load random theme from list above.
[ i ] toggle invert theme.
[ c ] clear screen.
[ - ] reset regexp filter.
[ q ] quit.
Framework Integration
Epilog can use log finders to look for logs inside app directories according to framework conventions so you don't need to aim at your latest log files mannualy. Ex:
$ epilog watch ~/www/my-project --app laravel # instead of long and boring $ epilog watch ~/www/my-project/app/storage/logs/log-cli-server-2015-01-11.txt
PRs implementing log finders to support your framework of choice are highly encouraged
Themes
Epilog themes are very simple yml files with hooks where you can put ANSI color escape sequences and literal text.
The hooks will decorate each log line, nyancatyze your terminal
and sometimes puke rainbows. Here is a theme example:
name: Punched Card author: Márcio Almada theme: extends: default # the log line template # template tags are: {date}, {level}, {logger}, {message}, {context}, {extra} template: "{level} {date} {message} [{logger}] [{context}] [{extra}]" # literal string that will be prepended to entire line prepend: "" # literal string that will be appended to entire line append: "\e[0m\n" # level section level: padding: 10 DEBUG: prepend: " • \e[2m" INFO: prepend: " • \e[2m" NOTICE: prepend: " • \e[2m" WARNING: prepend: " • \e[2m" ERROR: prepend: " • \e[1m" CRITICAL: prepend: " • \e[1m" ALERT: prepend: " • \e[1m" EMERGENCY: prepend: " • \e[1m" DEFAULT: prepend: " -------- \e[1m"
Which will make log lines look like the following, when interpreted:
Roadmap
- Basic functionalities
- Add
--appoption to allow easy framework integration. Ex:epilog watch /my/project --app laravel - Add
listencommand to aggregate log entries through a REST API. Ex:epilog listen --port 8888 - Add
servercommand to view logs in a browser instead of terminalepilog server <file> --port 8888 - Add better unicode support, more themes etc
- Bother with windows ... anyone?
- Other cool things, probably
- Release stable version
Contributions
Found a bug? Have an improvement? Take a look at the issues.
Guide
- Fork marc/epilog
- Clone forked repository
- Install composer dependencies
$ composer install - Run unit tests
$ phpunit - Modify code: correct bug, implement features
- Back to step 4
Copyright
Copyright (c) 2014-2015 Márcio Almada. Distributed under the terms of an MIT-style license. See LICENSE for details.
marc/epilog 适用场景与选型建议
marc/epilog 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.13k 次下载、GitHub Stars 达 34, 最近一次更新时间为 2014 年 09 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「log」 「Viewer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 marc/epilog 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marc/epilog 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 marc/epilog 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Laravel 5.x.x library for integration Monolog Sentry
Pacote simplificado para persistência de logs
Collection of tools to use the full power of the Enyalius framework
A beautiful, zero-dependency UI for querying and viewing AWS CloudWatch logs directly inside your Laravel application.
Provides a Log Viewer for Laravel
统计信息
- 总下载量: 1.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 35
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-09-20