See http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/SJSXP2.html for STAX vs DOM. Note that Log4j configurations are typically fairly small.
Unless some problem arises with using DOM I see no reason to change anything. Ralph On May 11, 2014, at 9:27 PM, Matt Sicker <[email protected]> wrote: > What about StAX? I haven't really used it before, though, so I don't know. I > try to use JAXB where possible to avoid the pain. > > > On 11 May 2014 20:36, Ralph Goers <[email protected]> wrote: > > Maybe, but with SAX you would have to write content handlers which, in my > experience would make the code ugly and harder to understand. > > Sent from my iPhone > > On May 11, 2014, at 5:02 PM, Matt Sicker <[email protected]> wrote: > >> SAX or StAX could be faster, especially since we're not using the DOM per se >> but a parallel in-memory DOM-like tree. >> >> >> On 11 May 2014 18:46, Ralph Goers <[email protected]> wrote: >> I can't imagine what would be faster than traversing the DOM as we currently >> are. >> >> Sent from my iPhone >> >> On May 11, 2014, at 11:46 AM, Matt Sicker <[email protected]> wrote: >> >>> JAXB wouldn't be as flexible as the current XML format, that's for sure. >>> I've also read on FasterXML's site that Woodstox is supposed to be faster >>> than Jackson with XML, but I haven't read much into that. >>> >>> >>> On 10 May 2014 22:24, Ralph Goers <[email protected]> wrote: >>> The reason I did the XML configuration the way I did was because it was >>> easy to map the Document to Nodes. I thought about using JAXB but it didn't >>> seem like a good fit. I didn't know about Jackson at the time but I am not >>> sure it would have been easier. >>> >>> Sent from my iPhone >>> >>> On May 10, 2014, at 7:45 PM, Gary Gregory <[email protected]> wrote: >>> >>>> FWIW, I am redoing the JSON and XML layouts to use the same Jackson code as >>>> for reading them back in for the listener side. In my impl, the context >>>> map is a IO'd as a map and the context stack as an array. >>>> >>>> As you may have seen despite the mail outage, I've been committing in >>>> chunks for the pieces I'll need before the new JSON/XML Jackson-based IO. >>>> Jackson is nice for that, we get 2-for-1, which make me wonder why we do >>>> not do our config reading using Jackson for XML. I suppose XML was impl'd >>>> before JSON and YAML. >>>> >>>> Gary >>>> >>>> >>>> On Sat, May 10, 2014 at 4:25 PM, <[email protected]> wrote: >>>> >>>> > Author: rgoers >>>> > Date: Sat May 10 20:25:28 2014 >>>> > New Revision: 1593727 >>>> > >>>> > URL: http://svn.apache.org/r1593727 >>>> > Log: >>>> > LOG4J2-623 - Format ThreadContext properties as a JSON map in JSONLayout >>>> > >>>> > Modified: >>>> > >>>> > logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java >>>> > >>>> > logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/JSONLayoutTest.java >>>> > logging/log4j/log4j2/trunk/src/changes/changes.xml >>>> > >>>> > Modified: >>>> > logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java >>>> > URL: >>>> > http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java?rev=1593727&r1=1593726&r2=1593727&view=diff >>>> > >>>> > ============================================================================== >>>> > --- >>>> > logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java >>>> > (original) >>>> > +++ >>>> > logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/JSONLayout.java >>>> > Sat May 10 20:25:28 2014 >>>> > @@ -253,34 +253,25 @@ public class JSONLayout extends Abstract >>>> > buf.append(','); >>>> > buf.append(this.eol); >>>> > buf.append(this.indent2); >>>> > - buf.append("\"Properties\":["); >>>> > - buf.append(this.eol); >>>> > + buf.append("\"Properties\": {"); >>>> > final Set<Entry<String, String>> entrySet = >>>> > event.getContextMap().entrySet(); >>>> > int i = 1; >>>> > for (final Map.Entry<String, String> entry : entrySet) { >>>> > - buf.append(this.indent3); >>>> > - buf.append('{'); >>>> > buf.append(this.eol); >>>> >>>> ----- Message truncated ----- >>>> >>>> >>>> >>>> >>>> -- >>>> E-Mail: [email protected] | [email protected] >>>> Java Persistence with Hibernate, Second Edition >>>> JUnit in Action, Second Edition >>>> Spring Batch in Action >>>> Blog: http://garygregory.wordpress.com >>>> Home: http://garygregory.com/ >>>> Tweet! http://twitter.com/GaryGregory >>> >>> >>> >>> -- >>> Matt Sicker <[email protected]> >> >> >> >> -- >> Matt Sicker <[email protected]> > > > > -- > Matt Sicker <[email protected]>
