How To Show Different Colors Per Level Using Log4perl

Use the following appender to show different colors. You can also customize the color per level.

log4perl.appender.SCREEN            = Log::Log4perl::Appender::ScreenColoredLevels
log4perl.appender.SCREEN.color.INFO = white
log4perl.appender.SCREEN.color.FATAL= bold underline blink red on_white

attributes
BOLD, DARK, UNDERLINE, UNDERSCORE, BLINK
colors
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE
background colors
ON_BLACK, ON_RED, ON_GREEN, ON_YELLOW, ON_BLUE, ON_MAGENTA, ON_CYAN, ON_WHITE

Log/Log4perl/Appender/ScreenColoredLevels.pm


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>