[logback-user] Logging from different threads

Lukas Zapletal lzap at seznam.cz
Fri Feb 27 10:46:46 CET 2009


Why not.

But what about patch with JUnit test? :-)

Give me a minute to bring on my IntelliJ...

LZ


Ceki Gulcu wrote:
> 
> 
> I meant to say, up to 12 parts, not just 12.
> 
> Ceki Gulcu wrote:
>> 
>> Checking the code, it appears that the abbreviation algorithm can handle 
>> names with 12 parts. Your class name has 13. It's a bug in the 
>> abbreviation algorithm.
>> Lukas, could you please enter a bug report?
>> 
>> Lukas Zapletal wrote:
>>> Upgrade to 0.9.15 did not help :-(
>>>
>>> I think logback should not skip records only for reason it cannot 
>>> shorten a
>>> name... what do you think?
>>>
>>> LZ
>>>
>>>
>>> Lukas Zapletal (gmail) wrote:
>>>> Hi
>>>>
>>>> I HAVE FOUND THE SOLUTION!
>>>>
>>>> The class not being logged is in very very long package. Its a :
>>>>
>>>> com.pike.puma.wm.isd2dita.core.g.project.server.pkg.isobjecttype.isobject 
>>>>
>>>>
>>>> I am using %logger{20} pattern and it seems this very long package 
>>>> cannot
>>>> even fit in this pattern (with only 20 characters permitted). I have
>>>> raised this value to 200 and now it works - the package and the log 
>>>> record
>>>> appears:
>>>>
>>>> com.pike.puma.wm.isd2dita.core.g.project.server.pkg.isobjecttype.isobject.ISObjectContentGenerator 
>>>>
>>>>
>>>> I would suppose that if the name of the logger is longer and cannot be
>>>> shortened to the limit something like
>>>> i.i.ISObjectContentGenerator
>>>> will appear throwing away beginning of the name. Not at all. I have
>>>> also
>>>> tried %logger{0} to see only "ISObjectContentGenerator" but this did
>>>> not
>>>> work too.
>>>>
>>>> Is this a bug? I am using version 0.9.9.
>>>>
>>>> LZ
>>>>
>>>>
>>>> Ceki Gulcu wrote:
>>>>>
>>>>> Hello Lukas,
>>>>>
>>>>> Your configuration file looks good. I see no reason why logging output
>>>>> should be generated correctly from some worker threads and not
>>>>> others. Are you sure that the silent thread is active?
>>>>>
>>>>> Here are some remarks about your configuration file *unrelated* to the
>>>>> problem your you are describing. As of logback version 0.9.15, if no
>>>>> class name is provided, layout property will default to
>>>>> PatternLayout. This, the next two configuration excerpts are
>>>>> equivalent:
>>>>>
>>>>> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
>>>>>    <!-- no class attribute specified -->
>>>>>    <layout>
>>>>>      <Pattern>%d{HH:mm:ss} [%thread] %-5level %logger{20} -
>>>>> %msg%n</Pattern>
>>>>>    </layout>
>>>>> </appender>
>>>>>
>>>>>
>>>>> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
>>>>>    <layout class="ch.qos.logback.classic.PatternLayout">
>>>>>      <Pattern>%d{HH:mm:ss} [%thread] %-5level %logger{20} -
>>>>> %msg%n</Pattern>
>>>>>    </layout>
>>>>> </appender>
>>>>>
>>>>> There is another minor observation I would like to make.
>>>>>
>>>>> Setting the level of a threshold filter to TRACE makes it (the filter)
>>>>> a pass through filter. The threshold filter in FileAppender is set to
>>>>> the level TRACE.  On the other hand, setting such a filter does not
>>>>> hurt either, except perhaps cluttering the configuration file.
>>>>>
>>>>> Lukas Zapletal wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I have application with 4 threads called M, 1, 2 and 3. Its using
>>>>>> Logback
>>>>>> over slf4j in normal way:
>>>>> [snip]
>>>>>
>>>>>   > The problem: I cannot see error messages logged by one of "worker"
>>>>> threads.
>>>>>> I have no clue why. Its not from freemarker.cache package - its
>>>>>> different
>>>>>> package (com.pike.blabla).
>>>>>>
>>>>>> -- 
>>>>>> Lukas Zapletal
>>>>>
>>>>> -- 
>>>>> Ceki Gülcü
>>>>> Logback: The reliable, generic, fast and flexible logging framework
>>>>> for
>>>>> Java.
>>>>> http://logback.qos.ch
>>>>> _______________________________________________
>>>>> Logback-user mailing list
>>>>> Logback-user at qos.ch
>>>>> http://qos.ch/mailman/listinfo/logback-user
>>>>>
>>>>>
>>>>
>>>
>>>
>>> -----
>>> -- 
>>> Lukas Zapletal
>>> http://lukas.zapletalovi.com
>> 
> 
> -- 
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for
> Java.
> http://logback.qos.ch
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
> 
> 


-----
--
Lukas Zapletal
http://lukas.zapletalovi.com
-- 
View this message in context: http://www.nabble.com/Logging-from-different-threads-tp22229676p22242500.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list