logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: core.impl.Log4jLogEvent.LogEventProxy
Date Tue, 01 Apr 2014 15:04:58 GMT
Oh good catch. Maybe in JDK9 they'll put JSON in there.


On 1 April 2014 07:39, Gary Gregory <garydgregory@gmail.com> wrote:

> OK, I've looked at EJ item #78, JAXB and Jackson a little more. Initially,
> it looks like #78 is specific to Java Serializable objects but the pattern
> should also apply to other "extralinguistic mechanisms" for marshalling.
> I'll go back and see my JAXB implementation can be made cleaner...
>
> Gary
>
>
> On Mon, Mar 31, 2014 at 9:11 PM, Ralph Goers <rgoers@apache.org> wrote:
>
>> I would use Jackson for JSON since we already use it.  I don't recall
>> that we use an XML serializer anywhere else so I would stick with either
>> JAXB or Jackson since they don't introduce any new dependencies.
>>
>> Ralph
>>
>> On Mar 31, 2014, at 5:34 PM, Gary Gregory <garydgregory@gmail.com> wrote:
>>
>> On Mon, Mar 31, 2014 at 10:21 AM, Ralph Goers <ralph.goers@dslextreme.com
>> > wrote:
>>
>>> Jackson will do both the JSON and XML if you want.  If you can manage to
>>> use the Proxy I think that would be better.
>>>
>>> Ralph
>>>
>>> So the options are:
>>
>> - JRE JAXB can do XML but not JSON
>> - Eclipse JAXB ("MOXy") can do XML and JSON
>> - Jackson can do both XML and JSON
>>
>> Because we already depend on Jackson it sounds like I should use that
>> instead of JAXB.
>>
>> Thoughts?
>>
>> Gary
>>
>> On Mar 31, 2014, at 7:04 AM, Gary Gregory <garydgregory@gmail.com> wrote:
>>>
>>> On Mon, Mar 31, 2014 at 2:36 AM, Ralph Goers <ralph.goers@dslextreme.com
>>> > wrote:
>>>
>>>> Out of curiosity, why does implementing an XML socket server require
>>>> touching the LogEvent?  What are XMLLogEventInput and JSONLogEventInput
>>>> going to do that would require that?
>>>>
>>>
>>> My current working implementation uses JAXB annotations on
>>> Log4jLogEvent, no need to deal with messy DOM nonsense. The XML layout can
>>> then be a one liner: JAXB.marshal(logEvent, result). Right now the socket
>>> server ends up also with a one liner to convert from XML to a Log4jLogEvent.
>>>
>>> But I could do it in the existing "proxy" log event instead or a new XML
>>> proxy instead of in Log4jLogEvent. I'm not sure why we'd want to create an
>>> extra object. So I am asking...
>>>
>>>  Gary
>>>
>>>>
>>>> Ralph
>>>>
>>>> On Mar 30, 2014, at 8:04 PM, Gary Gregory <garydgregory@gmail.com>
>>>> wrote:
>>>>
>>>> As I am working on LOG4J2-583<https://issues.apache.org/jira/browse/LOG4J2-583>I
ran into core.impl.Log4jLogEvent.LogEventProxy.
>>>>
>>>> - LogEventProxy is used to move events across threads internally
>>>> - A real Log4jLogEvent is used in the SerializedLayout.
>>>>
>>>> Why the different?
>>>>
>>>> As you answer, if you can avoid committing to Log4jLogEvent that would
>>>> be great as I currently have pending changes there related to
>>>> LOG4J2-583. <https://issues.apache.org/jira/browse/LOG4J2-583>
>>>>
>>>> I am wondering if SerializedLayout should use LogEventProxy or if
>>>> LogEventProxy is a leftover from old development.
>>>>
>>>> Thank you,
>>>> Gary
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> 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
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> 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
>>>
>>>
>>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> 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
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> 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
>



-- 
Matt Sicker <boards@gmail.com>

Mime
View raw message