Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2021-01-28 Thread Gary Gregory
Hi Volkan, I don't want to take the time to dig into the details but I am glad you found a resolution. My main concern is for binary compatibility of our call-site facing APIs, so breaking file formats is ok by me in this case. Gary On Thu, Jan 28, 2021, 05:59 Volkan Yazıcı wrote: > Gary, chec

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2021-01-28 Thread Volkan Yazıcı
Gary, check out the mess I caused by not accepting your proposal for renaming "type" to "format": LOG4J2-2973 . "type" conflicts with the array parsing semantics in properties file parser. Renaming "type" to "format" will allow us to read EventTemp

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-15 Thread Jochen Wiedmann
On Wed, Jul 15, 2020 at 10:06 AM Volkan Yazıcı wrote: > > The reason I wanted to go with a simple `String type` field is to keep > the impact surface and backward compatibility issues at the bay. > > I am in favor of `KeyValuePair` -- `KeyValuePair` feels like > an engineering overkill for our usa

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-15 Thread Volkan Yazıcı
The reason I wanted to go with a simple `String type` field is to keep the impact surface and backward compatibility issues at the bay. I am in favor of `KeyValuePair` -- `KeyValuePair` feels like an engineering overkill for our usages. That said, this translates to 368 occurrences of `KeyValuePai

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Ralph Goers
FWIW, this is one area Log4j could use improvement as the way it is done is too brittle. Ideally the Layout should be able to specify the format for all messages to use in a generic way. I don’t believe that is the case today. I am also sure user’s would like to be able to customize that to so

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Ralph Goers
That is true. There is at least one other place where we use “format” to differentiate between JSON, XML, and Java. See MapMessage. Ralph > On Jul 14, 2020, at 11:06 AM, Gary Gregory wrote: > > On Tue, Jul 14, 2020 at 1:55 PM Ralph Goers > wrote: > >> Right now the type field in EventTempl

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Gary Gregory
On Tue, Jul 14, 2020 at 1:55 PM Ralph Goers wrote: > Right now the type field in EventTemplateAdditionalField is an enum with > possible values of JSON or STRING. > This feels misnamed to me, JSON vs STRING is not a "type", JSON is a "format", as in JSON vs. XML, and STRING could be a "type" onl

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Ralph Goers
Right now the type field in EventTemplateAdditionalField is an enum with possible values of JSON or STRING. Ralph > On Jul 14, 2020, at 7:43 AM, Gary Gregory wrote: > > Hi All, > > There are three types of solutions I see to these kinds of wants, depending > of what the domain of the 'type' i

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Gary Gregory
Hi All, There are three types of solutions I see to these kinds of wants, depending of what the domain of the 'type' is: - KeyValuePair -> KeyValuePair or KeyValuePair and/or - Add a Class instance variable to denote the type, the hack usually reserved to workaround type erasure, or - Add somethin

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Volkan Yazıcı
Adding a "String type" field sounds pretty generic to me. What do you mean by "generic"? On Tue, Jul 14, 2020 at 4:10 PM Gary Gregory wrote: > > On Tue, Jul 14, 2020 at 8:51 AM Volkan Yazıcı > wrote: > > > May I add a "type" (of type String) parameter to KeyValuePair? Do you > > have any objecti

Re: Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Gary Gregory
On Tue, Jul 14, 2020 at 8:51 AM Volkan Yazıcı wrote: > May I add a "type" (of type String) parameter to KeyValuePair? Do you > have any objections? > Would we want to make this a generic? Gary > > On Mon, Jul 6, 2020 at 8:01 AM Ralph Goers > wrote: > > > > I finally got some time to start te

Adding type attribute to KeyValuePair (Was: Testing Json Template Layout)

2020-07-14 Thread Volkan Yazıcı
May I add a "type" (of type String) parameter to KeyValuePair? Do you have any objections? On Mon, Jul 6, 2020 at 8:01 AM Ralph Goers wrote: > > I finally got some time to start testing JsonTemplateLayout against the > logging in the cloud documentation. The first problem I ran into is that > a