I guess I do have one issue with Encoder. Logback essentially replaced Layout with Encoder. However, my recollection is that it was done as part of converting to having Layouts write to outputStreams using character encoding. The Encoder interface we have is confusing in that regard as it doesn’t really “encode” anything. In fact, this has me wondering if it wouldn’t make more sense to create a BufferedLayout interface that extends Layout (instead of the inheritance being the other way around). This would not break binary compatibility and the name would make more sense.
Ralph > On Apr 13, 2016, at 9:36 AM, Remko Popma <[email protected]> wrote: > > One usage is the StringBuilderEncoder class I just committed (it implements > Encoder<StringBuilder>). > > For binary layouts, this still needs more thinking, but log4j could have a > registry of custom encoders. Then, when a client logs an Order object we do a > lookup, find the Encoder<Order> and use that encoder to write the binary data > for the Order into the ByteBufferDestination. > > On Wed, Apr 13, 2016 at 9:37 PM, Mikael Ståldal <[email protected] > <mailto:[email protected]>> wrote: > How would such an Encoder look like? > > On Wed, Apr 13, 2016 at 12:40 AM, Remko Popma <[email protected] > <mailto:[email protected]>> wrote: > It does break binary compatibility, but since it's log4j-core (not api) we > agreed that this is acceptable here. > > The reason it's a separate super interface is that I plan to have other > Encoder implementations (perhaps user-specified) for binary logging. > > The Jira may have more details: > https://issues.apache.org/jira/browse/LOG4J2-1274 > <https://issues.apache.org/jira/browse/LOG4J2-1274> > > Sent from my iPhone > > On 2016/04/13, at 5:30, Gary Gregory <[email protected] > <mailto:[email protected]>> wrote: > >> Now that Layout extends Encoder and Encoder is new in 2.6, why not fold >> Encoder in Layout? >> >> Doesn't Layout extending a new type (Encoder) break BC anyway? >> >> Gary >> >> -- >> E-Mail: [email protected] <mailto:[email protected]> | >> [email protected] <mailto:[email protected]> >> Java Persistence with Hibernate, Second Edition >> <http://www.manning.com/bauer3/> >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> >> Spring Batch in Action <http://www.manning.com/templier/> >> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> >> Home: http://garygregory.com/ <http://garygregory.com/> >> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory> > > > -- > > > Mikael Ståldal > Senior software developer > > Magine TV > [email protected] <mailto:[email protected]> > Grev Turegatan 3 | 114 46 Stockholm, Sweden | www.magine.com > <http://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. > >
