wapmorgan/yii2-log-viewer

0.0.1 2019-03-21 21:47 UTC

This package is auto-updated.

Last update: 2022-05-11 09:22:04 UTC


README

Latest Stable Version

What is it? It's console script that colorizes and filters Yii2 log files (runtime/logs/app.log).

What it does? It colorizes all significant parts of log and can filter dumped variables (like $_GET, $_POST, etc.) and stack traces.

How to install it:

composer require wapmorgan/yii2-log-viewer

How to use it

First way (console command)

  1. Include yii2 console command into your project (in config/console.php):
'controllerMap' => [
  'log-viewer' => wapmorgan\Yii2LogViewer\LogViewerController::class,
]
  1. Run it:
./yii log-viewer runtime/logs/app.log

Second way (own binary)

  1. Use own binary:
./vendor/bin/yii2log-viewer --no-vars runtime/logs/app.log | less -R
// or file tail
tail runtime/logs/app.log | ~/.composer/vendor/bin/yii2log-viewer

Options

Available options:

Yii2 Log Colorizer & Filter.

Usage:
  yii2log-viewer [options] [-f] LOG_FILE
  yii2log-viewer [options] [-f] [-p]

Options:
  -p         Enables reading from pipe, not from file.
  -f         Enables following text file. To quit Ctrl+C.
  --no-trace Enables suppressing all back traces.
  --no-vars  Enables suppressing all exported variables (GET, POST, ...).

Example: Image