[slf4j-user] Configure Jansi highlight color

Daniel Ferber dffforum at gmail.com
Wed Jun 25 14:55:05 CEST 2014


Hi Joachim,

Unfortunately I could not find any configuration parameters for the logger
level colors.
Would it be a meaningful enhancement from logback to provide such
parameters within the xml configuration file?

For now, I was able to replace %highlight conversion with my own
implementation (which was copied from the original one).

In logback. xml:
<conversionRule conversionWord="highlight"

converterClass="br.com.danielferber.....logback.HighlightingCompositeConverter"
/>

In HighlightingCompositeConverter.java:
public class HighlightingCompositeConverter extends
ForegroundCompositeConverterBase<ILoggingEvent> {

    @Override
    protected String getForegroundColorCode(ILoggingEvent event) {
        Level level = event.getLevel();
        switch (level.toInt()) {
            case Level.ERROR_INT:
                return BOLD+RED_FG;
            case Level.WARN_INT:
                return YELLOW_FG;
            case Level.INFO_INT:
                return CYAN_FG;
            default:
                return DEFAULT_FG;
        }
    }
}


2014-06-25 5:20 GMT-03:00 Joachim Durchholz <jo at durchholz.org>:

> Am 25.06.2014 00:06, schrieb Daniel Ferber:
>
>  Hi,
>>
>> It it possible to change the color set that highlights messages with
>> Jansi?
>>
>> By default, info messages are print in dark blue, which is uncomfortable
>> to
>> read on windows prompt with black background. I think cyan would be more
>> suitable.
>>
>
> I think it's a general problem. I've seen this effect on
> - Windows terminal sessions
> - PuTTY
> - Linux consoles
>
> I think the proper place to fix that would be Jansi. Or whatever software
> layer actually translates the "dark blue" intention into an RGB triple.
>
> Of course for now, using a different color should avoid the problem.
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20140625/06c53d75/attachment.html>


More information about the slf4j-user mailing list