logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: null message factory?
Date Mon, 26 Oct 2015 16:38:13 GMT
Do we need to make the logger cache key be the logger name plus the message
factory name?

Gary
On Oct 26, 2015 8:52 AM, "Mikael Ståldal" <mikael.staldal@magine.com> wrote:

> Ah, that explains it.
>
> But how are you supposed to use Log4j 2 if you both use the JUL adapter
> and does logging directly through the Log4j 2 API in the same application?
>
> On Mon, Oct 26, 2015 at 2:09 PM, Ralph Goers <ralph.goers@dslextreme.com>
> wrote:
>
>> The JUL logger does.
>>
>> Ralph
>>
>> On Oct 26, 2015, at 3:07 AM, Mikael Ståldal <mikael.staldal@magine.com>
>> wrote:
>>
>> The strange thing is that I have not called LogManager.getLogger() with
>> any MessageFormat anywhere in my app.
>>
>> I am using the JUL adapter, the Log4j 1.2 adapter and the SLF4j impl. Can
>> any of those do it?
>>
>> On Sat, Oct 24, 2015 at 1:49 AM, Remko Popma <remko.popma@gmail.com>
>> wrote:
>>
>>> You called LogManager.getLogger(name) twice with the same name, once
>>> specifying a MessageFormat, once with just the name.
>>>
>>> When you specified just the name, you may expect to get a Logger with
>>> the default ParameterizedMessageFormat, but you're getting the cached
>>> instance with MessageFormat, so things may not work as expected.
>>>
>>> (At least I think that 's what it means.)
>>>
>>> Sent from my iPhone
>>>
>>> On 2015/10/23, at 22:36, Mikael Ståldal <mikael.staldal@magine.com>
>>> wrote:
>>>
>>> I get this warning with Log4j 2.4.1:
>>>
>>> was 2015-10-23 13:32:36,181 main WARN The Logger
>>> com.magine.contenturl.ContentUrlServer$ was created with the message
>>> factory
>>> org.apache.logging.log4j.message.MessageFormatMessageFactory@29bf34bb
>>> and is now requested with a null message factory (defaults to
>>> org.apache.logging.log4j.message.ParameterizedMessageFactory), which may
>>> create log events with unexpected formatting.
>>>
>>> It seems to work properly though. What does it mean?
>>>
>>> --
>>> [image: MagineTV]
>>>
>>> *Mikael Ståldal*
>>> Senior software developer
>>>
>>> *Magine TV*
>>> mikael.staldal@magine.com
>>> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com
>>>
>>> Privileged and/or Confidential Information may be contained in this
>>> message. If you are not the addressee indicated in this message
>>> (or responsible for delivery of the message to such a person), you may
>>> not copy or deliver this message to anyone. In such case,
>>> you should destroy this message and kindly notify the sender by reply
>>> email.
>>>
>>>
>>
>>
>> --
>> [image: MagineTV]
>>
>> *Mikael Ståldal*
>> Senior software developer
>>
>> *Magine TV*
>> mikael.staldal@magine.com
>> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com
>>
>> Privileged and/or Confidential Information may be contained in this
>> message. If you are not the addressee indicated in this message
>> (or responsible for delivery of the message to such a person), you may
>> not copy or deliver this message to anyone. In such case,
>> you should destroy this message and kindly notify the sender by reply
>> email.
>>
>>
>
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>

Mime
View raw message