Re: Layouts requiring headers vs. message based appenders

2015-11-13 Thread Mikael Ståldal
I don't think so, this is what is expected. It currently says: The Layout to use to format the LogEvent. If you do not specify a layout, the appender will send the formatted message to Kafka as a UTF-8 encoded string. On Thu, Nov 12, 2015 at 8:45 PM, Gary Gregory wrote: > Does that need to be

Re: Layouts requiring headers vs. message based appenders

2015-11-12 Thread Gary Gregory
Does that need to be documented? Gary On Thu, Nov 12, 2015 at 2:09 AM, Mikael Ståldal wrote: > I have made KafkaAppender support SerializedLayout as a special case. > > On Mon, Nov 9, 2015 at 5:53 PM, Mikael Ståldal > wrote: > >> So how should we handle this? Make KafkaAppender support Seriali

Re: Layouts requiring headers vs. message based appenders

2015-11-12 Thread Mikael Ståldal
I have made KafkaAppender support SerializedLayout as a special case. On Mon, Nov 9, 2015 at 5:53 PM, Mikael Ståldal wrote: > So how should we handle this? Make KafkaAppender support SerializedLayout > as a special case? > > On Mon, Nov 9, 2015 at 5:35 PM, Ralph Goers > wrote: > >> I don’t thin

Re: Layouts requiring headers vs. message based appenders

2015-11-09 Thread Mikael Ståldal
For JSON, a single message (an object) is also a valid complete unit, and I guess that is also true for XML. BTW, I believe that JsonLayout is broken. When you use , you get output like this: [ { "timeMillis" : 1447088521228, "thread" : "main", "level" : "INFO", "loggerName" : "com.twitte

Re: Layouts requiring headers vs. message based appenders

2015-11-09 Thread Mikael Ståldal
So how should we handle this? Make KafkaAppender support SerializedLayout as a special case? On Mon, Nov 9, 2015 at 5:35 PM, Ralph Goers wrote: > I don’t think the header and footer make any sense with some appenders. > Even with XML, the JMSAppender or KafkaAppender would want to send each > me

Re: Layouts requiring headers vs. message based appenders

2015-11-09 Thread Ralph Goers
I don’t think the header and footer make any sense with some appenders. Even with XML, the JMSAppender or KafkaAppender would want to send each message as a complete unit, so I would expect that every message would contain the complete XML message. Ralph > On Nov 9, 2015, at 8:47 AM, Mikael St

Re: Layouts requiring headers vs. message based appenders

2015-11-09 Thread Mikael Ståldal
It currently does not work with KafkaAppender since it does not use header / footer. We could change that, but is that the proper way to do it? That would mean that for JsonLayout each message would look like "[{...}]", I think it make more sense with just "{...}". BTW, does it work for JmsAppende

Re: Layouts requiring headers vs. message based appenders

2015-11-09 Thread Remko Popma
I think the layout header/footer idea was originally designed with HTML/XML format log files in mind. For a File appender (where the "unit of work" is a file) that means write the layout's header at startup and write the layout's footer at rollover or shutdown. Still, the concept is general en

Layouts requiring headers vs. message based appenders

2015-11-09 Thread Mikael Ståldal
This JIRA issue: https://issues.apache.org/jira/browse/LOG4J2-1195 points out that we have kind of a conceptual problem. Some layouts, such as SerializedLayout, require a header. This does not work with message based appenders with layout support like KafkaAppender (and I guess JmsAppender and Jer