title: Configuring Apache Spark Logging with Scala and logback
body: <p>I am very confused with setting up logging with Apache Spark. Apache spark used Log4j for logging and it generates huge amount of log data. 
  Is there a way to setup log4j for spark logs and use logback for application log. I am quite conversant with logback but <strong>it seems</strong> spark only support log4j.
  Below piece of code was working fine till i introduced apache spark. Any help in this regard will be helpful.</p>
  
  <pre><code>import com.typesafe.scalalogging.LazyLogging
  
  import scala.util.{Failure, Success}
  import scala.xml.{Elem, XML}
  
  
  
  object MainApp extends App with LazyLogging  {
  
  
  
    val currency = new YahooCurrencyLoader() with CurrencyParameters
    val ccy = currency.getXML(currency.ccyUrl) match {
  
      case Success(v) =&gt; XML.save("PreviousRun.xml",v); logger.info("XML has been saved for use")
      case Failure(ex) =&gt; logger.error("XML extraction failed. Look at Yahoo extraction class. ${ex.getMessage}" )
  
    }
  
    val xmllocation: String = "./PreviousRun.xml"
    val loadxml: Elem = XML.loadFile(xmllocation)
    //print(loadxml)
    //print(currency.findCurrency(loadxml,"GBP"))
  
    logger.info("USD CAD Cross is " + currency.findCurrency(loadxml,"CAD").head)
  </code></pre>