title: Getting parameters of Spark submit while running a Spark job
body: <p>I am running a spark job by spark-submit and using its --files parameter to load a log4j.properties file.</p>
  
  <p>In my Spark job I need to get this parameter</p>
  
  <pre><code>object LoggerSparkUsage {
  
  def main(args: Array[String]): Unit = {
  //DriverHolder.log.info("unspark")
  println("args are....."+args.mkString(" "))
  val conf = new SparkConf().setAppName("Simple_Application")//.setMaster("local[4]")
  val sc = new SparkContext(conf)
   // conf.getExecutorEnv.
  val count = sc.parallelize(Array(1, 2, 3)).count()
  println("these are files"+conf.get("files"))
  LoggerDriver.log.info("log1 for info..")
  LoggerDriver.log.info("log2 for infor..")
  f2
  
  }
  def f2{LoggerDriver.log.info("logs from another function..")}
  
  }
  </code></pre>
  
  <p>my spark submit is something like this:
      /opt/mapr/spark/spark-1.6.1/bin/spark-submit  --class "LoggerSparkUsage" --master yarn-client --files src/main/resources/log4j.properties /mapr/cellos-mapr/user/mbazarganigilani/SprkHbase/target/scala-2.10/sprkhbase_2.10-1.0.2.jar</p>
  
  <p>I tried to get the properties using
  conf.get("files")</p>
  
  <p>but it gives me an exception</p>
  
  <p>can anyone give me a solution for this?</p>