<?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 Config log4j in Spark - Driver Logs in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Config-log4j-in-Spark-Driver-Logs/m-p/91325#M21711</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use the custom log4j to gather Spark driver logs( submitting jobs under CLUSTER mode), but unable to achieve it.&lt;/P&gt;&lt;P&gt;Here is my custom log4j.properties file content:&lt;/P&gt;&lt;P&gt;log4j.rootCategory=ALL,FILE&lt;BR /&gt;log4j.appender.FILE=org.apache.log4j.RollingFileAppender&lt;/P&gt;&lt;P&gt;#Below is the unix server path from where job is getting submitted&lt;BR /&gt;log4j.appender.FILE.File=/some/path/to/edgeNode/SparkDriver.log&lt;/P&gt;&lt;P&gt;log4j.appender.FILE.Append=false&lt;BR /&gt;log4j.appender.FILE.layout=org.apache.log4j.PatternLayout&lt;BR /&gt;log4j.appender.FILE.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And cmnd to submit job:&lt;/P&gt;&lt;P&gt;spark2-submit --files /apps/test/config/driver_log4j.properties --conf "spark.driver.extraJavaOptions=-Dlog4j.configuration=driver_log4j.properties" --master yarn --deploy-mode cluster --num-executors 2 --executor-cores 4 --driver-memory 1g --executor-memory 16g --keytab XXXXX.keytab --principal XXXXX --class com.test.spark.par_1_submit par_submit.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error I'm getting:&lt;/P&gt;&lt;PRE&gt;java.io.FileNotFoundException: /some/path/to/edgeNode/SparkDriver.log (No such file or directory)&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Sep 2022 14:25:54 GMT</pubDate>
    <dc:creator>akv31</dc:creator>
    <dc:date>2022-09-16T14:25:54Z</dc:date>
    <item>
      <title>Config log4j in Spark - Driver Logs</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Config-log4j-in-Spark-Driver-Logs/m-p/91325#M21711</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use the custom log4j to gather Spark driver logs( submitting jobs under CLUSTER mode), but unable to achieve it.&lt;/P&gt;&lt;P&gt;Here is my custom log4j.properties file content:&lt;/P&gt;&lt;P&gt;log4j.rootCategory=ALL,FILE&lt;BR /&gt;log4j.appender.FILE=org.apache.log4j.RollingFileAppender&lt;/P&gt;&lt;P&gt;#Below is the unix server path from where job is getting submitted&lt;BR /&gt;log4j.appender.FILE.File=/some/path/to/edgeNode/SparkDriver.log&lt;/P&gt;&lt;P&gt;log4j.appender.FILE.Append=false&lt;BR /&gt;log4j.appender.FILE.layout=org.apache.log4j.PatternLayout&lt;BR /&gt;log4j.appender.FILE.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And cmnd to submit job:&lt;/P&gt;&lt;P&gt;spark2-submit --files /apps/test/config/driver_log4j.properties --conf "spark.driver.extraJavaOptions=-Dlog4j.configuration=driver_log4j.properties" --master yarn --deploy-mode cluster --num-executors 2 --executor-cores 4 --driver-memory 1g --executor-memory 16g --keytab XXXXX.keytab --principal XXXXX --class com.test.spark.par_1_submit par_submit.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error I'm getting:&lt;/P&gt;&lt;PRE&gt;java.io.FileNotFoundException: /some/path/to/edgeNode/SparkDriver.log (No such file or directory)&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:25:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Config-log4j-in-Spark-Driver-Logs/m-p/91325#M21711</guid>
      <dc:creator>akv31</dc:creator>
      <dc:date>2022-09-16T14:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Config log4j in Spark - Driver Logs</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Config-log4j-in-Spark-Driver-Logs/m-p/91327#M21712</link>
      <description>&lt;P&gt;As your intent seems to capture the driver logs in a separate file while executing the app in the cluster mode, make sure that '&lt;SPAN&gt;/some/path/to/edgeNode/' dir is present on all of the NodeManager essentially as in cluster mode the driver will be running in the Yarn app's application master. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you can't make sure that follow a general practice to provide log file path to some pre-existing paths e.g. "/var/log/SparkDriver.log".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 08:01:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Config-log4j-in-Spark-Driver-Logs/m-p/91327#M21712</guid>
      <dc:creator>_Umesh</dc:creator>
      <dc:date>2019-06-07T08:01:59Z</dc:date>
    </item>
  </channel>
</rss>

