tail highlight while logging

tail -f -n 3100 /as/jboss/domain/servers/sname/log/server.log |sed ‘s#DEBUG#\x1b[33m&#; s#ERROR#\x1b[31m&#; s#REQUEST URI:#\x1b[32m&#; s#RESPONSE: #\x1b[36m&#; s#INFO#\x1b[37m&#’
$colorFormats = array(
// styles
// italic and blink may not work depending of your terminal
‘bold’ => “33[1m%s33[0m”,
‘dark’ => “33[2m%s33[0m”,
‘italic’ => “33[3m%s33[0m”,
‘underline’ => “33[4m%s33[0m”,
‘blink’ => “33[5m%s33[0m”,
‘reverse’ => “33[7m%s33[0m”,
‘concealed’ => “33[8m%s33[0m”,
// foreground colors
‘black’ => “33[30m%s33[0m”,
‘red’ => “33[31m%s33[0m”,
‘green’ => “33[32m%s33[0m”,
‘yellow’ => “33[33m%s33[0m”,
‘blue’ => “33[34m%s33[0m”,
‘magenta’ => “33[35m%s33[0m”,
‘cyan’ => “33[36m%s33[0m”,
‘white’ => “33[37m%s33[0m”,
// background colors
‘bg_black’ => “33[40m%s33[0m”,
‘bg_red’ => “33[41m%s33[0m”,
‘bg_green’ => “33[42m%s33[0m”,
‘bg_yellow’ => “33[43m%s33[0m”,
‘bg_blue’ => “33[44m%s33[0m”,
‘bg_magenta’ => “33[45m%s33[0m”,
‘bg_cyan’ => “33[46m%s33[0m”,
‘bg_white’ => “33[47m%s33[0m”,
);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s