[
https://issues.apache.org/jira/browse/KAFKA-4710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yuto Kawamura updated KAFKA-4710:
---------------------------------
Status: Open (was: Patch Available)
> Logging trait breaking logging location information retrival by log4j
> ---------------------------------------------------------------------
>
> Key: KAFKA-4710
> URL: https://issues.apache.org/jira/browse/KAFKA-4710
> Project: Kafka
> Issue Type: Bug
> Components: core
> Affects Versions: 0.10.0.1
> Reporter: Yuto Kawamura
> Assignee: Yuto Kawamura
> Priority: Minor
> Labels: log4j
>
> We have in-house logging systems which sends problematic logs such as WARNs
> and ERRORs to the counting system.
> The log4j appender is provided to send logs to the system. However, currently
> the most of logs written by Kafka broker are actually pointing the line of
> {{Logging}} trait since the most of them are written through calling
> {{Logging}} trait's helper method.
> This happens when we add some modifiers such as {{%l}} to log4j appender
> pattern as well:
> {code}
> diff --git a/config/log4j.properties b/config/log4j.properties
> index bf816e76d..e1b69e0da 100644
> --- a/config/log4j.properties
> +++ b/config/log4j.properties
> @@ -23,7 +23,7 @@
> log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH
> log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log
> log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout
> -log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
> +log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c) - %l%n
> {code}
> {code}
> [2017-01-30 15:48:28,333] INFO starting (kafka.server.KafkaServer) -
> kafka.utils.Logging$class.info(Logging.scala:68)
> [2017-01-30 15:48:28,339] INFO Connecting to zookeeper on localhost:2181
> (kafka.server.KafkaServer) - kafka.utils.Logging$class.info(Logging.scala:68)
> [2017-01-30 15:48:34,908] FATAL Fatal error during KafkaServer startup.
> Prepare to shutdown (kafka.server.KafkaServer) -
> kafka.utils.Logging$class.fatal(Logging.scala:116)
> {code}
> As you can see, all locations are pointing somewhere of {{Logging.scala}}
> rather than the actual locations where logs are written.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)