<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark job submit log messages on console in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-job-submit-log-messages-on-console/m-p/163044#M125418</link>
    <description>&lt;P&gt;To configure log levels, add &lt;/P&gt;&lt;PRE&gt;--conf "spark.driver.extraJavaOptions=-Dlog4j.configuration=log4j-spark.properties" 
--conf "spark.executor.extraJavaOptions=-Dlog4j.configuration=log4j-spark.properties" 
&lt;/PRE&gt;&lt;P&gt;This assumes you have a file called log4j-spark.properties on the classpath (usually in resources for the project you're using to build the jar. This log4j can then control the verbosity of spark's logging. &lt;/P&gt;&lt;P&gt;I usually use something derived from the spark default, with some customisation like:&lt;/P&gt;&lt;PRE&gt;# Set everything to be logged to the console
log4j.rootCategory=WARN, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n


# Settings to quiet third party logs that are too verbose
log4j.logger.org.spark-project.jetty=WARN
log4j.logger.org.spark-project.jetty.util.component.AbstractLifeCycle=ERROR
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
log4j.logger.org.apache.parquet=ERROR
log4j.logger.parquet=ERROR


# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support
log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL
log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR
log4j.logger.org.apache.spark.sql=WARN

# Logging for this application
log4j.logger.com.myproject=INFO
&lt;/PRE&gt;&lt;P&gt;Something else to note here is that in yarn cluster mode, all your important logs (especially the executor logs) will be aggregated by the YARN ATS when the application finishes. You can get these with &lt;/P&gt;&lt;PRE&gt;yarn logs -applicationId &amp;lt;application&amp;gt;&lt;/PRE&gt;&lt;P&gt;This will show you all the  log based on your config levels.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2016 22:41:52 GMT</pubDate>
    <dc:creator>sball</dc:creator>
    <dc:date>2016-04-08T22:41:52Z</dc:date>
  </channel>
</rss>

