Colorize Monitoring of Logs

28,905

Solution 1

Generic Colouriser (grc):

enter image description here

Works with many different file formats.

Example:

grc tail -f /var/log/apache/access.log /var/log/apache/error.log

Multitail:

alt text

Works with even more file formats :) And is more of a full blown "tail" with multi windows, diff outputs etc.. Very useful.

Examples:

Merge 2 logfiles in one window:

multitail /var/log/apache/access.log -I /var/log/apache/error.log

In one window show all new TCP connections and their state changes using netstat while in the other window displaying the merged access and error logfiles of apache

multitail -R 2 -l "netstat -t" /var/log/apache/access.log -I /var/log/apache/error.log

Solution 2

Check out CCZE, it does the job for me. You have a choice of curses, ansi and html output.

Solution 3

Monitor '/applications' highlighted;

tail -f /var/log/system.log | grep /Applications --color

Solution 4

Check out glTail (http://www.fudgie.org/). Does way more than you're asking, but maybe that's OK

Solution 5

Colorize is very good tool for simply piping your text through another filter to get fancy ANSI colors. In fact, it's one simple 4kB perl script (almost half of it is just documentation) and it's based on regular expressions.

You can highlight whole line containing given patern (good for hiding unwanted debug logs or highlighting Exceptions) or just highlight pattern in uncolored line (highlighting http response codes).

I have several presets for various file types in separate runnable files. Then I just run mvn clear install | colorbuild, tail -f *.log* | colorlog or svn diff | colordif to have really fancy output.

Share:
28,905

Related videos on Youtube

Ian
Author by

Ian

Updated on September 17, 2022

Comments

  • Ian
    Ian almost 2 years

    I sometimes monitor apache and php error logs using tail under FreeBSD. Is there any way to get colorized output, either using tail or some other command line app?

    Alternatively, what is your favorite way to monitor the various web-related logs in realtime?

  • mpbloch
    mpbloch almost 15 years
    Where is the download link? It's broken at that site. Screenshot looks good, but, without a link....
  • mpbloch
    mpbloch almost 15 years
    Ok, I found it under Lenny packages, but I am missing some files I guess. I'll get ncurses.
  • nbv4
    nbv4 over 11 years
    that grep will also filter the results
  • sendmoreinfo
    sendmoreinfo over 11 years
    abandonware (master site no longer exists)
  • user2418702
    user2418702 over 10 years
  • Salvador P.
    Salvador P. about 8 years
    It's working for me in ubuntu 16.04LTS, just apt-get install ccze. To use it, "tail -f /var/log/apache2/error.log | ccze" It's really useful you can export the output to html too!
  • User9102d82
    User9102d82 about 6 years
    [Host@root:~]# yum install ccze -y