dev@glassfish.java.net

logger printing message param twice

From: Bobby Bissett - Javasoft <Robert.Bissett_at_Sun.COM>
Date: Fri, 23 Feb 2007 12:48:09 -0500

I have code that is logging a Level.SEVERE message as so:

     logger.log(Level.SEVERE, "some_key", someObject);

With log string:

     some_key=My message {0}

In the log output, I'm seeing the someObject.toString() text twice, once
before "My message" and once again after. Is this by design? It creates
too much output this way (the object is an expired cert and it prints
~25 lines).

I see in UniformLogFormatter.uniformLogFormat() it calls
getNameValuePairs() before appending the message and object, and
getNameValuePairs() appends someObject.toString() before returning so
that the same information is in the log message twice.

Can someone tell me if this is a bug? If not, is there a different way
to call the logger so I don't generate this much output? I would like to
give as much information as possible in this message (it's SEVERE), but
I don't want to give it twice.

Thanks,
Bobby