[logback-user] ANSI coloring?
adam.n.gordon at gmail.com
Thu Jun 7 17:22:07 CEST 2012
Ack. Sorry. That wasn't clear. Who controls [ERROR] being red, for example? That was the question I was trying to ask. If the highlight.xml file is what controls this, along with the ability to set the actual terminal codes (our terminal codes add bold, e.g., to some of the log levels), I believe we can use this.
On Jun 7, 2012, at 8:49 AM, ceki wrote:
> Hi Adam,
> Color control is done within the pattern by color converters which are just composite converters, i.e. converters containing other conveters. Here is a sample "pattern" property:
> <pattern>%highlight(%-5level) %cyan(%logger) - %msg%n</pattern>
> Note the %highlight and %cyan composite conversion specifiers which contain other conversion specifiers (you can have as many as you want).
> For instance, the following is legal:
> <pattern>%highlight(%-5level %logger - %msg)%n</pattern>
> The %highlight specifier is implemented by HighlightingCompositeConverter  all in about 10 lines of code.
>  http://goo.gl/YJA8T
> On 07.06.2012 15:53, Adam Gordon wrote:
>> I'm on my mobile at the moment so I can't look at highlight.xml. I
>> would assume that this file controls the color to log level mapping?
>> I wrote a custom encoder a while ago that essentially does this,
>> however, am happy to upgrade to the latest logback and see if it will
>> work for us. if so, I'm happy to use it and have one less dependency.
>> will check later this morning.
>> On Jun 7, 2012, at 2:49, ceki<ceki at qos.ch> wrote:
>>> Hello all,
>>> Has anyone had a chance to try ANSI coloring  as introduced in
>>> logback 1.0.5? It's a seemingly cool feature but I am curious whether
>>> it's actually useful.
>>>  http://logback.qos.ch/manual/layouts.html#coloring
> Logback-user mailing list
> Logback-user at qos.ch
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Logback-user