ccze is a wonderful tool that brings real joy to the arduous task of reading or searching thru log files. It uses a modular approach to support custom colour formatting for popular applications such as Apache, Postfix, Exim, etc.
Install ccze on CentOS and Fedora linux
First enable Epel repository and run following command:
1 |
# yum install ccze -y |
Install ccze on Debian/Ubuntu linux
On Debian/Ubuntu, you can use apt-get to install:
1 |
~$ sudo apt-get install ccze -y |
How to use ccze tool
ccze colourises logs that are sent to standard out, for example, we can use tailf to follow a log file and then prettify the output by piping to ccze, examples:
1 |
~$ tail /var/log/syslog | ccze -A |
d
You can also export log files to html file using ccze tool:
1 |
~$ cat /var/log/syslog | ccze -h > ~/Desktop/syslog.html |
… and open it in your favorite browser afterwards.