[slf4j-user] Release of SLF4J version 1.5.9-RC0

ekkehard ekkehard at gentz-software.de
Sat Sep 5 15:25:42 CEST 2009


Ceki Gulcu schrieb:
>
> Two bits of information should answer your question.
>
>  1) A LocLogger *is* a Logger and can be used as such.
>  2) When you write
>
>  Logger lx = LoggerFactory.getLogger("X");
>  LocLogger llx = llFactory.getLocLogger("X");
>
> then "llx" is actually a wrapper around that very "lx". (llx wraps 
> that very specific "lx").
>
> So, if in a given class you are doing both regular and localized 
> logging, the LocLogger is sufficient for both needs.
>
GREAT
> ekkehard wrote:
>> thx for info...
>> seems I have to create an extra blog for localized logging in my 
>> current blog series about
>> logging in osgi enterprise applications ;-) 
>> http://ekkescorner.wordpress.com/blog-series/osgi-apps/
>
> Getting the word out on CAL10 would be highly welcome.
>
I'll do my best ;-)

I also have to test if CAL10N fits into the eclipse-way-of-localized 
messages

For my enterprise projects I think there's a use-case for CAL10N:
I'm using ENUMs heavily and these ENUMs will be displayed in SWT UI as
single-choice-selection, combo or list (depends on size)

the UI is model-driven and generated (using redView http://redview.org) and
at the moment we 'show' the ENUM literal as value and I'm just looking 
for the best way
how the business user can translate these ENUMs and redView can display
them automagically in the right locale. looks like an ideal job for CAL10N

ekke
>> another question:
>> localized log messages makes much sense for systems running at 
>> customer site,
>> but while developing and using DEBUG levels the messages usually will 
>> be only in english
>>
>> does this mean I need two loggers for each class ?
>
> No. Two bits of information should clarify the point.
>
>  1) A LocLogger *is* a Logger and can be used as such.
>  2) When you write
>
>  Logger lx = LoggerFactory.getLogger("X");
>  LocLogger llx = llFactory.getLocLogger("X");
>
> then "llx" is actually a wrapper around that very "lx". (llx wraps 
> that very specific "lx").
>
> So, if in a given class you are doing both regular and localized 
> logging, the LocLogger is sufficient for both needs.
>
>> logger.debug(...my debug messages with parameters...)
>> and
>> locLogger(...my info, warn, error ENUM messages...)
>>
>> or will the underlying Logback system only use one Logger if the name 
>> is the same ?
>>
>> whats the recommended way to do logging with enums and without in the 
>> same class ?
>
> A LocLogger should cover both needs. However, it is possible that a 
> class needs to do logging before it has a chance to get a handle on a 
> LogLoggerFactory, in that case, a regular Logger would be used.
>
>> thx
>>
>> ekke
>>




More information about the slf4j-user mailing list