title: Log4J with JUnit Tests
body: <p>I would like to add logging to my Selenium Java tests. I have implemented the log4jFramework which works well either placing the logs in the console or in a file. </p>
  
  <p>I am using the JUnit test framework and I would like to include the test name and date/time in the filename of the logfile rather than using the standard convention which seems to be to prepend a number +1 to the file if a file already exists. </p>
  
  <p>This is my log4j.properties file...</p>
  
  <pre><code>log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender
  log4j.appender.rollingFile.File=~/Desktop/Selenium/AutomationLogs/automationLog
  log4j.appender.rollingFile.MaxFileSize=2MB
  log4j.appender.rollingFile.MaxBackupIndex=2
  log4j.appender.rollingFile.layout = org.apache.log4j.PatternLayout
  log4j.appender.rollingFile.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %p %t %c - %m%n
  </code></pre>
  
  <p>What I have found online only seems relevant to daily rolling files. I would like to generate a new file for the logs every time I run a unit test</p>