[logback-user] Please someone explain %c layout pattern to me

Ceki Gulcu ceki at qos.ch
Fri Feb 27 15:07:22 CET 2009


Assume the conversion specifier "%logger{3}" and logger name 
"mainPackage.sub.sample.Bar". This will result in "m.s.s.Bar" which is the 
shortest string containing representations for all package names, plus the full 
name of the rightmost segment (the class name). The package names are 
represented by a single letter.

Does that make sense?

Lukas Zapletal wrote:
> I cant clearly  understand the documentation of the conversion word %c
> 
> http://logback.qos.ch/manual/layouts.html
> 
> I thought %c{10} will always return string at maximum length 10 but
> its obviously not true. In the JUnit test "hello.world" is abbreviated
> "h.world" while length set to 1.
> 
> Seems its a maximum length of the string before the last dot?!?
> 
> Thanks
> 
> -----
> --
> Lukas Zapletal
> http://lukas.zapletalovi.com

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


More information about the Logback-user mailing list