logging-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [log4j] org.apache.logging.log4j.message.MapMessage.put(String, String)
Date Fri, 12 Jan 2018 06:29:54 GMT
Hi Ralph,

I will have to look at the generics in the morning but my requirement from
day one is that a MapMessage allow values of any type (String keys are
fine.) where each value in a MapMessage can be of a different types. A
specific Appender can decide what to do with the values. Having all Strings
as values would not be good for all of the use cases I have (JMS, JDBC, and
MongoDB.) JDBC should pass values down to its prepared statement with
PreparedStatement.setObject(int,Object) for example. Same idea for MongoDB.
All this works now, which is nice.

Gary

On Thu, Jan 11, 2018 at 9:24 PM, Ralph Goers <ralph.goers@dslextreme.com>
wrote:

> In looking at the history MapMessage only supported Strings until you
> modified it last June. It appears to me you did it incorrectly. You made
> MapMessage generic but left the put and putAll methods as only supporting
> String values. I am not sure why you would have done that instead of having
> them use the same generic.  It also seems to be a problem that you added
> all these with methods that allow arbitrary crap to be added to the Map
> despite what the generic declaration says.
>
> Ralph
>
> > On Jan 11, 2018, at 4:28 PM, Gary Gregory <garydgregory@gmail.com>
> wrote:
> >
> > I can use one of the with() methods so no big deal.
> >
> > Gary
> >
> > On Thu, Jan 11, 2018 at 4:23 PM, Ralph Goers <ralph.goers@dslextreme.com
> >
> > wrote:
> >
> >> I will have to look but as I recall I did that for a reason.
> >>
> >> Sent from my iPhone
> >>
> >>> On Jan 11, 2018, at 3:37 PM, Gary Gregory <garydgregory@gmail.com>
> >> wrote:
> >>>
> >>> It seems to me that:
> >>>
> >>> org.apache.logging.log4j.message.MapMessage.put(String, String)
> >>>
> >>> should really be:
> >>>
> >>> org.apache.logging.log4j.message.MapMessage.put(String, Object)
> >>>
> >>> Thoughts?
> >>>
> >>> Gary
> >>
> >>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message