Hi
If you run the programm within eclipse it's quite easy by defining two
appenders with different levels. The clou is that the destination of the first
appender goes to System.err, the second to System.out:
<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
%-10X{category} [%-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
%-10X{category} [%-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>
<filter class="ch.ergonomics.pms.common.supervision.TraceDenyFilter"/>
<filter class="ch.ergonomics.pms.common.supervision.XMLDenyFilter"/>
</appender>
You can customize a separate eclipse instance only to run your program.
Heri
> -----Original Message-----
> From: Andy McBride [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 19, 2005 12:57 AM
> To: 'Log4J Users List'
> Subject: RE: Colors in console appender
>
>
> I spent ages once trying to get this to work on windows
> without success.
>
> Appenders are available (as you found) which work on
> unix/linux but with all
> the windows ansi hacks I could find, I still couldn't get it
> to work on
> windows xp.
>
> My advice would be to not bother (unless anyone else has the
> solution) :-(
>
> I've used a SoundAppender in a development environment to
> highlight error
> messages with humorous results dependant on the choice of
> .wav file used :-)
>
> Regards
>
> Andy
>
> > -----Original Message-----
> > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> > Sent: 18 April 2005 23:46
> > To: Log4J User
> > Subject: Colors in console appender
> >
> > Hey all... is it possible to color-code messages written to
> the console
> > with ConsoleAppender? I tried using ANSI escape sequences, but it
> > didn't seem to work. I also found:
> >
> > http://dsd.lbl.gov/sea/api/src-
> > html/gov/lbl/dsd/sea/nio/util/ColorConsoleAppender.html
> >
> > But it didn't seem to work either... If it's actually
> possible I'll take
> > the time to figure out why, but I'd hate to waste time on
> something that
> > won't work no matter what. This is on Windows by the way,
> I don't need
> > it color-coded in a Unix environment.
> >
> > Thanks in advance!
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]