Skip to content

production-minds/prettylog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

A simple log prettifier extensible with syntax parsers for various log formats.

Components are log entries are colored for easy skimming, and data parts are printed as pretty JSON.

Usage

tail -f /var/log/php5-fpm.log | prettylog

Arguments

To print only messages matching or above the specified monolog level (see RFC5424):

--min-level="debug|info|notice|warning|error|critical|alert|emergency"

Alternative short syntax:

-l debug|info|notice|warning|error|critical|alert|emergency

When filtered for log level, prettylog will print a dot for each omitted log message. Disable this by:

--no-dots

prettylog will also add a yellow "time gap" line between log entries that are more than 30 seconds apart. Disable this by:

--no-gaps

To highlight text in the output (ANSI mode only) use the --hilite (or -H) option:

--hilite=text
--hilite='some words'

You can also provide regular expressions (following the PCRE syntax if you start the hilite value with a slash / and end it with / or /i (for case-insensitive):

--hilite='/reg(ular)? ?ex(pression)?/i'

To print the usage and options:

--help

Supported formats

Currently there are parsers for:

As part of my daily routine I tend to deal with the following log formats too, so I will probably add parsers for:

  • nginx access and error logs (need to add support for multi-line log entries)
  • supervisor logs

Version 0.8-dev

This is an early release. Use at your own risk. Comments and suggestions are welcome.

Building

Install composer:

curl -sS https://getcomposer.org/installer | php

Install box:

curl -LSs https://box-project.github.io/box2/installer.php | php
sudo mv box.phar /usr/local/bin/box
chmod 755 /usr/local/bin/box

Build:

box build

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages