One way to monitor multiple logs simultaneous is to use tail. Although this works, and works well, if the logs are modified frequently, they seem to scroll endlessly and messily. What is meant by messily. As a log file is modified, it takes precedence over the previous log as it updates the terminal. One way around this is with multitail.
To install on CentOS 6.
yum install -y epel-release yum install -y multitail |
To use it is just as easy as using tail.
multitail /var/log/httpd/*_log |
Display 3 logfiles in 2 columns
multitail -s 2 /var/log/maillog /var/log/messages /var/log/httpd/access_log |
Run a command and view the log file.
multitail /var/log/httpd/*_log -l "wget http://www.mywebsite.com" |
Modify colors
To change from the default color scheme, create a config file. For example, call multitail -cS test_log /path/to/log
with the following ~/.multitailrc
:
colorscheme:test_log cs_re:green:INFO cs_re:red:SEVERE |
Source(s)
http://linux.die.net/man/1/multitail
http://www.cyberciti.biz/tips/multitail-view-multiple-files-like-tail-command.html
http://unix.stackexchange.com/questions/8414/how-to-have-tail-f-show-colored-output