title: Setting properties for logging in java
body: <p>Before you read this, you should know that I am a python developer in uncharted Java territory. </p>
  
  <p>I am trying to set up logging for Java. I was able to get it to work when I set the logging.properties. Like this:</p>
  
  <pre><code>$ /usr/bin/java -server -Xmx512m -Djava.util.logging.config.file= /path/to/logging/file/logging.properties -jar start.jar
  </code></pre>
  
  <p>The <code>logging.properties</code> file is checked into revision control and in my current set up is to be used in all environments, so I don't want to hard code the logging.FileHandler.pattern in the <code>logging.properties</code> file. So, I tried to move that to the command line, by doing this:</p>
  
  <pre><code>$ /usr/bin/java -server -Xmx512m -Djava.util.logging.config.file= /path/to/logging/file/logging.properties -Djava.util.logging.FileHandler.pattern=/var/log/project_name/solr/solr.log -jar start.jar
  </code></pre>
  
  <p>But it seems that the FileHandler.pattern wasn't recognized, so the the file never wrote. So, then I thought, well, let's just ditch the <code>logging.properties</code> file and try to throw everything on the command line. So, then I tried this: </p>
  
  <pre><code>$ /usr/bin/java -server -Xmx512m -Djava.util.logging.Handler=java.util.logging.FileHandler -D.level=WARNING -Djava.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter -Djava.util.logging.FileHandler.pattern=/var/log/project_name/solr/solr.log -jar start.jar
  </code></pre>
  
  <p>But that didn't work either. So, I am asking for help. </p>
  
  <p>Three questions:</p>
  
  <ol>
  <li>Why didn't the second example I provided work? </li>
  <li>Why didn't the third example I provided work?</li>
  <li>Since the logging.properties file is checked into version control and is a shared file, what is the right approach to this? What is the best practice?</li>
  </ol>
  
  <p>When responding, please used small words for us Java newbies. :-)</p>