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]> wrote: > How would such an Encoder look like? > > On Wed, Apr 13, 2016 at 12:40 AM, Remko Popma <[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 >> >> Sent from my iPhone >> >> On 2016/04/13, at 5:30, Gary Gregory <[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] | [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 >> Home: http://garygregory.com/ >> Tweet! http://twitter.com/GaryGregory >> >> > > > -- > [image: MagineTV] > > *Mikael Ståldal* > Senior software developer > > *Magine TV* > [email protected] > Grev Turegatan 3 | 114 46 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. >
