title: How to choose the location of a log file for a Java application in a platform independent way?
body: <p>I'm writing a java application. Currently this produces a file called "trace.txt" in the same directory the .jar file lives. This can sometimes cause issue with file permissions, eg writing to C:\Program Files\Foo\trace.txt. </p>
  
  <p>After a bit of research on SO it seems the general opinion is to log to Application Data\Foo\ for the given user. This won't be the same location for other OS's.</p>
  
  <p>What's the best practice in this situation? I'm using java.util.logging.</p>