title: log4j log file in user home directory
body: <p>I am working on an application that will run on OSX and windows. I want the logs to be written to the users home directory. For OSX it will be under the /Users//Library/Application Support/MyApp/log directory, and under windows depending on the version under /Users//AppData/MyApp/log directory. </p>
  
  <p>What is the best way I can do this? I have looked around for solutions for this, but nothing helpful or a solution I am comfortable using has come up. </p>
  
  <p>Look forward to your inputs. </p>
  
  <p>edit: 
  Since the location of the log file depends on the OS, I am hoping to find a run time solution, possibly something like below</p>
  
  <pre><code>if (System.getProperty("os.name").contains("mac"))
      logFileLocation = System.getProperty("user.home") + "/Library/Application Support/MyApp/logs"
  else
      logFileLocation = System.getenv("APPDATA") + "/MyApp/logs"
  </code></pre>
  
  <p>Thanks</p>