[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-dev
Subject:    Re: core.impl.Log4jLogEvent.LogEventProxy
From:       Gary Gregory <garydgregory () gmail ! com>
Date:       2014-03-31 18:55:07
Message-ID: wuvmdcyps3osd3sr2k5e39sk.1396292106480 () email ! android ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

Oops I'll check again.

-------- Original message --------
From: Ralph Goers <ralph.goers@dslextreme.com> 
Date:03/31/2014  13:45  (GMT-05:00) 
To: Log4J Developers List <log4j-dev@logging.apache.org> 
Subject: Re: core.impl.Log4jLogEvent.LogEventProxy 

Didn’t you read my email last night?  SerializedLayout DOES use the proxy.   Read \
item #78 in Effective Java.

Ralph

On Mar 31, 2014, at 10:42 AM, Gary Gregory <garydgregory@gmail.com> wrote:

Should the Serialized layout use the proxy?

Gary


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

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 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.

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
JUnit in Action, Second Edition
Spring Batch in Action
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
JUnit in Action, Second Edition
Spring Batch in Action
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
JUnit in Action, Second Edition
Spring Batch in Action
Blog: http://garygregory.wordpress.com 
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


[Attachment #3 (text/html)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=UTF-8"></head><body >Oops I'll check again.<br><br>-------- Original message \
--------<br>From: Ralph Goers <ralph.goers@dslextreme.com> <br>Date:03/31/2014  13:45 \
(GMT-05:00) <br>To: Log4J Developers List <log4j-dev@logging.apache.org> <br>Subject: \
Re: core.impl.Log4jLogEvent.LogEventProxy <br><br><div>Didn't you read my email last \
night? &nbsp;SerializedLayout DOES use the proxy. &nbsp; Read item #78 in Effective \
Java.</div><div><br></div><div>Ralph</div><br><div><div>On Mar 31, 2014, at 10:42 AM, \
Gary Gregory &lt;<a href="mailto:garydgregory@gmail.com">garydgregory@gmail.com</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div \
dir="ltr"><div>Should the Serialized layout use the \
proxy?<br><br></div>Gary<br></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Mon, Mar 31, 2014 at 10:21 AM, Ralph Goers <span \
dir="ltr">&lt;<a href="mailto:ralph.goers@dslextreme.com" \
target="_blank">ralph.goers@dslextreme.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word">Jackson will do both the \
JSON and XML if you want. &nbsp;If you can manage to use the Proxy I think that would \
be better.<span class="HOEnZb"><font color="#888888"><div> \
<br></div><div>Ralph</div></font></span><div><div class="h5"><br><div><div>On Mar 31, \
2014, at 7:04 AM, Gary Gregory &lt;<a href="mailto:garydgregory@gmail.com" \
target="_blank">garydgregory@gmail.com</a>&gt; wrote:</div> <br><blockquote \
type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, \
Mar 31, 2014 at 2:36 AM, Ralph Goers <span dir="ltr">&lt;<a \
href="mailto:ralph.goers@dslextreme.com" \
target="_blank">ralph.goers@dslextreme.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Out of \
curiosity, why does implementing an XML socket server require touching the LogEvent? \
&nbsp;What are XMLLogEventInput and JSONLogEventInput going to do that would require \
that?</div>

</div></blockquote><div><br></div><div>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.<br>

<br></div><div>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...<br><br> </div>
<div>Gary<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div \
style="word-wrap:break-word"><span><font color="#888888"><div><br></div> \
<div>Ralph</div><br></font></span><div><div><div>On Mar 30, 2014, at 8:04 PM, Gary \
Gregory &lt;<a href="mailto:garydgregory@gmail.com" \
target="_blank">garydgregory@gmail.com</a>&gt; wrote:</div><br></div><div> \
<blockquote type="cite"><div dir="ltr"><div><div><div>As I am working on <a \
href="https://issues.apache.org/jira/browse/LOG4J2-583" rel="12703875" \
target="_blank">LOG4J2-583</a> I ran into core.impl.Log4jLogEvent.LogEventProxy.<br>

<br>- LogEventProxy is used to move events across threads internally<br>
</div>- A real Log4jLogEvent is used in the SerializedLayout.<br><br></div>Why the \
different?<br><br></div>As you answer, if you can avoid committing to Log4jLogEvent \
that would be great as I currently have pending changes there related to <a \
href="https://issues.apache.org/jira/browse/LOG4J2-583" rel="12703875" \
target="_blank">LOG4J2-583.</a><div>


<div><div><br></div><div>I am wondering if SerializedLayout should use LogEventProxy \
or if LogEventProxy is a leftover from old development.<br></div><div><br>Thank \
you,<br></div><div>Gary<br></div><div>-- <br><div dir="ltr">


E-Mail: <a href="mailto:garydgregory@gmail.com" \
target="_blank">garydgregory@gmail.com</a> | <a href="mailto:ggregory@apache.org" \
target="_blank">ggregory@apache.org </a><br><a href="http://www.manning.com/bauer3/" \
target="_blank">Java Persistence with Hibernate, Second Edition</a><br>


<a href="http://www.manning.com/tahchiev/" target="_blank">JUnit in Action, Second \
Edition</a><br><a href="http://www.manning.com/templier/" target="_blank">Spring \
Batch in Action</a><br>Blog: <a href="http://garygregory.wordpress.com/" \
target="_blank">http://garygregory.wordpress.com</a> <br>


Home: <a href="http://garygregory.com/" \
target="_blank">http://garygregory.com/</a><br>Tweet! <a \
href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a></div> \
</div><div><div></div></div></div></div></div> \
</blockquote></div></div><br></div></blockquote></div><br><br clear="all"><br>-- \
<br><div dir="ltr">E-Mail: <a href="mailto:garydgregory@gmail.com" \
target="_blank">garydgregory@gmail.com</a> | <a href="mailto:ggregory@apache.org" \
target="_blank">ggregory@apache.org </a><br>

<a href="http://www.manning.com/bauer3/" target="_blank">Java Persistence with \
Hibernate, Second Edition</a><br><a href="http://www.manning.com/tahchiev/" \
target="_blank">JUnit in Action, Second Edition</a><br><a \
href="http://www.manning.com/templier/" target="_blank">Spring Batch in \
Action</a><br>

Blog: <a href="http://garygregory.wordpress.com/" \
target="_blank">http://garygregory.wordpress.com</a> <br>Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br>Tweet! \
<a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a></div>


</div></div>
</blockquote></div><br></div></div></div></blockquote></div><br><br \
clear="all"><br>-- <br><div dir="ltr">E-Mail: <a href="mailto:garydgregory@gmail.com" \
target="_blank">garydgregory@gmail.com</a> | <a href="mailto:ggregory@apache.org" \
target="_blank">ggregory@apache.org </a><br> <a href="http://www.manning.com/bauer3/" \
target="_blank">Java Persistence with Hibernate, Second Edition</a><br><a \
href="http://www.manning.com/tahchiev/" target="_blank">JUnit in Action, Second \
Edition</a><br><a href="http://www.manning.com/templier/" target="_blank">Spring \
                Batch in Action</a><br>
Blog: <a href="http://garygregory.wordpress.com/" \
target="_blank">http://garygregory.wordpress.com</a> <br>Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br>Tweet! \
<a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a></div>

</div>
</blockquote></div><br></body>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic