[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-07-03 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531848#comment-16531848
 ] 

ASF subversion and git services commented on LOG4J2-2312:
-

Commit b7ac37fa7a2090b978020fb15b19328bf5597039 in logging-log4j2's branch 
refs/heads/release-2.x from [~ckozak]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=b7ac37f ]

LOG4J2-2312 LOG4J2-2341 Fix jackson layout with async loggers

AsyncLoggerContextSelector RingBufferLogEvents were not properly
handled by the jackson layout. Currently the jackson layout
implementation requires Log4jLogEvent instances, so we must
convert all other LogEvent implementations into these.

This closes #187


> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Assignee: Carter Kozak
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531782#comment-16531782
 ] 

ASF GitHub Bot commented on LOG4J2-2312:


Github user asfgit closed the pull request at:

https://github.com/apache/logging-log4j2/pull/187


> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Assignee: Carter Kozak
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-07-03 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531780#comment-16531780
 ] 

ASF subversion and git services commented on LOG4J2-2312:
-

Commit 34cc745705b0c33d79ef326032edf9cb212fc26f in logging-log4j2's branch 
refs/heads/master from [~ckozak]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=34cc745 ]

LOG4J2-2312 LOG4J2-2341 Fix jackson layout with async loggers

AsyncLoggerContextSelector RingBufferLogEvents were not properly
handled by the jackson layout. Currently the jackson layout
implementation requires Log4jLogEvent instances, so we must
convert all other LogEvent implementations into these.

This closes #187


> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Assignee: Carter Kozak
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531548#comment-16531548
 ] 

ASF GitHub Bot commented on LOG4J2-2312:


Github user cakofony commented on a diff in the pull request:

https://github.com/apache/logging-log4j2/pull/187#discussion_r199848400
  
--- Diff: log4j-layout-jackson-json/pom.xml ---
@@ -55,6 +55,11 @@
   test-jar
   ${project.version}
 
+
+  com.lmax
+  disruptor
+  test
+
--- End diff --

Required to construct a RingBufferLogEvent


> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Assignee: Carter Kozak
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-07-03 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16531537#comment-16531537
 ] 

ASF GitHub Bot commented on LOG4J2-2312:


GitHub user cakofony opened a pull request:

https://github.com/apache/logging-log4j2/pull/187

LOG4J2-2312 LOG4J2-2341 Fix jackson layout with async loggers

AsyncLoggerContextSelector RingBufferLogEvents were not properly
handled by the jackson layout. Currently the jackson layout
implementation requires Log4jLogEvent instances, so we must
convert all other LogEvent implementations into these.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cakofony/logging-log4j2 
LOG4J2-2312_LOG4J2-2341

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/logging-log4j2/pull/187.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #187


commit fd1006b2f26d2c3860ddd907dc8ac9ba7e7239f6
Author: Carter Kozak 
Date:   2018-07-03T15:13:34Z

LOG4J2-2312 LOG4J2-2341 Fix jackson layout with async loggers

AsyncLoggerContextSelector RingBufferLogEvents were not properly
handled by the jackson layout. Currently the jackson layout
implementation requires Log4jLogEvent instances, so we must
convert all other LogEvent implementations into these.




> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (LOG4J2-2312) Using async appender with json layout causes only the message to be written

2018-04-25 Thread Andrew Oberstar (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16452748#comment-16452748
 ] 

Andrew Oberstar commented on LOG4J2-2312:
-

I've run into the same issue (I'm using 2.11.0). If I use

 

```

-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector

```

 

My logs only contain:

 

```

"My message"

```

 

If I don't use the aync context selector:

 

```

{
  "thread" : "main",
  "level" : "INFO",
  "loggerName" : "com.example.Main",
  "message" : "My message",
  "endOfBatch" : false,
  "loggerFqcn" : "org.apache.logging.log4j.spi.AbstractLogger",
  "instant" : {
    "epochSecond" : 1524677715,
    "nanoOfSecond" : 88300
  },
  "contextMap" : \{ },
  "threadId" : 1,
  "threadPriority" : 5
}

```

 

 

> Using async appender with json layout causes only the message to be written
> ---
>
> Key: LOG4J2-2312
> URL: https://issues.apache.org/jira/browse/LOG4J2-2312
> Project: Log4j 2
>  Issue Type: Bug
>Reporter: David Knapp
>Priority: Major
> Attachments: async_trace.txt, synchronous_trace.txt
>
>
> When using the async appender combined with the JsonLayout, you only get the 
> results of the message being written to the appender.
>  
> I took a look at it seems like this is because RingBufferLogEvent implements 
> ReusableMessage which is where jackson gets the MessageSerializer, whereas 
> the non async LogEvent doesn't, so it gets the BeanSerializer
> Attached are traces, both of which originating from the 
> MessageSerializer.serialize method



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)