dev@glassfish.java.net

Re: Am i missing something...

From: vince kraemer <vince.kraemer_at_oracle.com>
Date: Thu, 04 Aug 2011 08:53:57 -0700

Thanks...

I was 'missing' the association of the message key with the logger...

That makes sense.

vbk

Tom Mueller wrote:
> Loggers are associated with a resource bundle. In GlassFish, this is the LogStrings.properties file that is in the Java package of the class that is passed in to the getLogger method. When you pass a message key to the log method, it automatically uses the message from the resource bundle.
>
> Tom
>
>
>
> On Aug 4, 2011, at 12:47 AM, vince kraemer <vince.kraemer_at_oracle.com> wrote:
>
>
>> Hi all,
>>
>> I am seeing a number of lines of code that look something like this (some classnames are 'complete' to avoid ambiguity...)
>>
>> java.util.logging.Logger.getLogger("foo").log(Level.FINE, "text.that.looks.like.a.message.key", new Object[] { a, b, c });
>>
>> I think that will just put the message
>>
>> text.that.looks.like.a.message.key
>>
>> into the log when the level is set to FINE or finer...
>>
>> That seems like it won't be very useful.
>>
>> So, I must be missing something... can somebody let me know?
>>
>> Thanks,
>> vbk
>>