[ 
https://issues.apache.org/jira/browse/AVRO-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858929#comment-15858929
 ] 

Suraj Acharya commented on AVRO-1960:
-------------------------------------

It was missing the license and had some whitespace issues.
I have gone ahead. Made those changes and have committed the same.

The output now looks like :
{code}
sacharya@sacharya-MBP:~/repos/avro/lang/java/tools$ java -jar 
target/avro-tools-1.9.0-SNAPSHOT.jar tojson ./target/mapred/in/lines.avro/
17/02/08 21:12:43 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
"the quick brown fox jumps over the lazy dog"
"the cow jumps over the moon"
"the rain in spain falls mainly on the plains"

{code}

If other properties need to be added, we can add it at a later time as a new 
issue.

> 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)

Reply via email to