[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-07-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14622834#comment-14622834
 ] 

Hüseyin Kartal commented on LOG4J2-1068:



I got more. The applied patch seems not enough to fix.

Please ReOpen.


Below a stackTrace for better understanding.


As you can see i use also a Patched version of the 
ExtendedThrowablePatternConverter.

In the following processing the ThrowableProxy try to access 
this.causeProxy.getThrowable() which is also null because its transient.

2015-07-10 21:01:59,395 ERROR An exception occurred processing Appender OUT 
java.lang.NullPointerException
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.formatCause(ThrowableProxy.java:190)
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.getExtendedStackTraceAsString(ThrowableProxy.java:347)
-  at 
org.apache.logging.log4j.extending.PatchedExtendedThrowablePatternConverter.format(PatchedExtendedThrowablePatternConverter.java:54)
at 
org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36)
at 
org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:196)
at 
org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:55)
at 
org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:71)
at 
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:108)
at 
org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.append(RollingRandomAccessFileAppender.java:98)
at 
org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:99)
at 
org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.callAppenders(AsyncAppender.java:290)
at 
org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.run(AsyncAppender.java:241)


For Unit test log the following Exception to a SocketAppender. Maybe u can use 
Andy's test case.

   Configuration of my the SocketAppender

   Appender type=Socket name=OUT-SOCKET host=${sys:log.host} 
port=${sys:log.port} protocol=${sys:log.protocol}
  Layout type=JsonLayout compact=true eventEol=true 
complete=true properties=true /
   /Appender



@Test
public final void testThrowableProxyOnServer() {

Logger logger = LogManager.getLogger();

IllegalArgumentException cause = new IllegalArgumentException();
cause.setStackTrace(Thread.currentThread().getStackTrace());

IllegalArgumentException exception = new 
IllegalArgumentException(cause.getMessage(), cause);
exception.setStackTrace(Thread.currentThread().getStackTrace());

logger.catching(exception);
}


I sorry, but i have no patch for this issue, but i assume ThrowableProxy should 
not use Throwable instances direct at all.

Hüseyin

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan
 Fix For: 2.4

 Attachments: patch.txt


 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-07-10 Thread Andy McMullan (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14622928#comment-14622928
 ] 

Andy McMullan commented on LOG4J2-1068:
---

I think this problem has already been fixed by 
https://issues.apache.org/jira/browse/LOG4J2-1067

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan
 Fix For: 2.4

 Attachments: patch.txt


 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-07-10 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14623000#comment-14623000
 ] 

Gary Gregory commented on LOG4J2-1068:
--

Can you test by building from the Git master, or download a SNAPSHOT?

Gary

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan
 Fix For: 2.4

 Attachments: patch.txt


 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-06-24 Thread Andy McMullan (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600171#comment-14600171
 ] 

Andy McMullan commented on LOG4J2-1068:
---

I have attached a patch.

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan
 Attachments: patch.txt


 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-06-24 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600274#comment-14600274
 ] 

Gary Gregory commented on LOG4J2-1068:
--

YW, got more?

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan
 Fix For: 2.4

 Attachments: patch.txt


 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1068) Exceptions not logged when using TcpSocketServer + SerializedLayout

2015-06-24 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599505#comment-14599505
 ] 

Gary Gregory commented on LOG4J2-1068:
--

Could you please provide a patch with a unit test?

 Exceptions not logged when using TcpSocketServer + SerializedLayout
 ---

 Key: LOG4J2-1068
 URL: https://issues.apache.org/jira/browse/LOG4J2-1068
 Project: Log4j 2
  Issue Type: Bug
  Components: Pattern Converters
Affects Versions: 2.1, 2.2, 2.3
Reporter: Andy McMullan

 This issue was reported in BugZilla bug 57036: 
 https://bz.apache.org/bugzilla/show_bug.cgi?id=57036.   The description there 
 covers the problem well:
 ... in the Method format(final LogEvent event, final StringBuilder 
 toAppendTo) in ExtendedThrowablePatternConverter writing the Stacktrace in 
 the logfile on condition that the Throwable throwable from Log4jLogEvent is 
 not null, but on the Socketserver the Throwable throwable is always null, 
 because it's defined as transient.
 I couldn't find the bug here in Jira, so I'm reporting again in case it has 
 been lost in the migration.
 It's a major problem with a simple fix, so seems like it should be a high 
 priority.
 I've worked around it for now by plugging in my own 
 ExtendedThrowablePatternConverter.  My fix is to change this line:
 if (throwable != null  options.anyLines() {
 to this:
 if ((throwable != null || proxy != null)  options.anyLines()) {



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org