[ 
https://issues.apache.org/jira/browse/KAFKA-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandra Nowak updated KAFKA-847:
-----------------------------------

    Attachment: KAFKA-847-v2.patch

A patch file containing changes only in KafkaLog4jAppender

> kafka appender layout does not work for kafka 0.7.1
> ---------------------------------------------------
>
>                 Key: KAFKA-847
>                 URL: https://issues.apache.org/jira/browse/KAFKA-847
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.7.1, 0.8.0
>         Environment: Win7 64 bit
>            Reporter: Sining Ma
>            Assignee: Jun Rao
>              Labels: easyfix, newbie
>         Attachments: KAFKA-847-v1.patch, KAFKA-847-v2.patch
>
>
> I am using kafka 0.7.1 right now.
> I am using the following log4j properties file and trying to send some log 
> information to kafka server.
> log4j.rootLogger=INFO,file,stdout
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=[%d] %p %t %m (%c)%n
> log4j.appender.file=org.apache.log4j.RollingFileAppender
> #log4j.appender.file.FileNamePattern=c:\\development\\producer-agent_%d{yyyy-MM-dd}.log
> log4j.appender.file.File=${AC_DATA_HOME}\\lmservice\\tailer-aggregator.log
> log4j.appender.file.MaxFileSize=100MB
> log4j.appender.file.MaxBackupIndex=1
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> #log4j.appender.file.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n
> log4j.appender.file.layout.ConversionPattern=[%d] %p %t %m (%c)%n
> log4j.appender.KAFKA=kafka.producer.KafkaLog4jAppender
> log4j.appender.KAFKA.layout=org.apache.log4j.PatternLayout
> log4j.appender.KAFKA.layout.ConversionPattern=[%d] %p %t %m (%c)%n
> log4j.appender.KAFKA.BrokerList=0:localhost:9092
> log4j.appender.KAFKA.SerializerClass=kafka.serializer.StringEncoder
> log4j.appender.KAFKA.Topic=test.topic
> # Turn on all our debugging info
> log4j.logger.kafka=INFO, KAFKA
> log4j.logger.org=INFO, KAFKA
> log4j.logger.com=INFO, KAFKA
> However, I find that the messages send to kafka server are not formatted as 
> my defined layout. 
> KafkaLog4jAppender just sends messages(%m), and there is no other conversion 
> patterns.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to