79101613

Date: 2024-10-18 10:19:05
Score: 1
Natty:
Report link

In order to make spark read the log4j.config file follow below steps:

  1. Add log4j.config file in root directory in your local
  2. Go to Spark directory: search for conf folder and add the following to spark-defaults.conf.template: spark.driver.extraJavaOptions -Dlog4j.configuration=file:log4j.properties -Dspark.yarn.app.container.log.dir=app-logs -Dlogfile.name=hello-spark

in the above example I app-logs refer to the directory where my application logs will be collected and hello-spark is the name of the log file. change these according to your use case. It works!!!

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Anupama Peddi