title: Scala Log4j configuration
body: <p>So I'm trying to set up log4j in my scala code. This is what I have so far:</p>
  
  <p><code>LogHelper.scala</code></p>
  
  <pre><code>package myPackage
  
  import org.apache.log4j.Logger
  
  trait LogHelper {
      val loggerName: String = this.getClass.getName
      lazy val logger: Logger = Logger.getLogger(loggerName)
  }
  </code></pre>
  
  <p><code>my class</code></p>
  
  <p>package myPackage</p>
  
  <pre><code>class MyClass extends LogHelper {
  
      ...
      logger.debug("my message")
      ...
  
  }
  </code></pre>
  
  <p>But I don't really know where the logs go, or how to make it print to a file. My code is running a spark job which I run with spark-submit. How do I set this up to print to both the console and a log file?</p>