[
https://issues.apache.org/jira/browse/SAMZA-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269954#comment-14269954
]
Yan Fang commented on SAMZA-479:
--------------------------------
[~criccomini], Let me go one step back.
1. This ticket was extracted from [your
comment|https://issues.apache.org/jira/browse/SAMZA-310?focusedCommentId=14223333&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14223333]
(3) and [~martinkl]'s comment in
[RB|https://reviews.apache.org/r/28035/#comment103608].
2. So my understanding is that users may use logging, such as
{code}
Map<String, Object> jsonObject
jsonObject.put("foo", anyObject)
log.info(jsonObject)
{code}
instead of simply
{code}
log.info("string")
{code}
Right?
3. In order to encode the json, we need to have serde, like what we have for
messages and keys, such as, *.msg.serde=json.
4.
{quote}
Why does the system need to have two serdes?
{quote}
This is because, the samza itself is using the string, whenever a user adds a
json logging format, there will be string serde + json serde. I was thinking
there was only one appender. After second thought, I think different serdes go
to different appenders. So it will be like
{code}
<appender name="string-serde-StreamAppender"
class="org.apache.samza.logging.log4j.StreamAppender"></appender>
<appender name="json-serde-StreamAppender"
class="org.apache.samza.logging.log4j.StreamAppender"></appender>
<root> <appender-ref ref="string-serde-StreamAppender"/> </root>
<logger name="com.json.log.package"><appender-ref
ref="json-serde-StreamAppender" /></logger>
{code}
Is this what was in your mind ? After doing this, I think one stream will only
have one serde. My previous statement is not correct.
> Make StreamAppender pluggable for different log formats
> -------------------------------------------------------
>
> Key: SAMZA-479
> URL: https://issues.apache.org/jira/browse/SAMZA-479
> Project: Samza
> Issue Type: Improvement
> Affects Versions: 0.9.0
> Reporter: Yan Fang
> Assignee: Yan Fang
> Fix For: 0.9.0
>
>
> Currently the StreamAppender only accepts String and sends String as the
> format for all the logs. It will be useful to have StreamAppender to accept
> and send other formats, such as Avro, JSON, etc. So the idea is to move the
> encoding of the LoggingEvent to a serde.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)