[
https://issues.apache.org/jira/browse/AVRO-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858933#comment-15858933
]
ASF subversion and git services commented on AVRO-1960:
-------------------------------------------------------
Commit 656b2bb525b087d3d65f93a58f566164616e1766 in avro's branch
refs/heads/master from [~sacharya]
[ https://git-wip-us.apache.org/repos/asf?p=avro.git;h=656b2bb ]
AVRO-1960 Add log4j properties for avro-tools
Originally contributed by Clément MATHIEU <[email protected]>
Additional changes were made by Suraj Acharya
Signed-off-by: sacharya <[email protected]>
> avro-tools should not display log4j warning when started with java -jar
> -----------------------------------------------------------------------
>
> Key: AVRO-1960
> URL: https://issues.apache.org/jira/browse/AVRO-1960
> Project: Avro
> Issue Type: Improvement
> Components: java
> Affects Versions: 1.8.1
> Reporter: Clément MATHIEU
> Attachments: AVRO-1960.patch
>
>
> When started as a regular java application, ie. java -jar, avro-tools
> displays an annoying log4j warning:
> {noformat}
> $ java -jar target/avro-tools-1.9.0-SNAPSHOT.jar tojson
> ./target/mapred/in/lines.avro/
> log4j:WARN No appenders could be found for logger
> (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more
> info.
> {noformat}
> log4j should be properly initialized in the two supported execution contexts:
> regular jar & hadoop jar.
> When run as a regular jar, log4j looks for a {{log4j.properties}} or
> {{log4j.xml}} in the classpath and displays the aforementioned warning
> message if none is found. IMHO, we should provide a default configuration
> file. User will still be able to override the log4j configuration using
> {{-Dlog4j.configuration}}.
> When run with {{hadoop jar}}, {{hadoop-config.sh}} puts {{HADOOP_CONF_DIR}}
> first in the classpath. Since {{HADOOP_CONF_DIR}} contains a
> {{log4j.properties}}, the one provided by avro-tools won't be used, which
> seems fine. Here again, users can use {{-Dlog4j.configuration}} if they need.
> What do you think of adding a simple log4j.properties file into
> src/main/resources ? What would be a good default log4j configuration ?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)