Since you do not specify which displaying application shall show colors I can
give you advice how to achieve it within the eclipse console display:
Configure two separate appenders. One for the levels WARN and higher and one
for the levels INFO and lower. Assign them to the std.err and std.out. Here a
config example:
<appender name="CONSOLE.ERR" class="org.apache.log4j.ConsoleAppender">
<param name="target" value="System.err"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{HH:mm:ss.SSS} (%6r) %-5p
[%-7t] %F:%L %x - %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="warn"/>
<param name="LevelMax" value="fatal"/>
<param name="AcceptOnMatch" value="false"/>
</filter>
</appender>
<appender name="CONSOLE.OUT" class="org.apache.log4j.ConsoleAppender">
<param name="target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{HH:mm:ss.SSS} (%6r) %-5p
[%-7t] %F:%L %x - %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="debug"/>
<param name="LevelMax" value="info"/>
<param name="AcceptOnMatch" value="false"/>
</filter>
</appender>
Eclipse console will display WARN and higher in red, INFO and lower in black
color.
Heri
> -----Original Message-----
> From: youhaodeyi [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 15, 2008 9:50 AM
> To: [email protected]
> Subject: How can I set the output color of log4j?
>
>
>
> I want to set different colors for different priority log.
> How can I do that?
> --
> View this message in context:
> http://www.nabble.com/How-can-I-set-the-output-color-of-log4j-
> -tp16065799p16065799.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]