title: How to write logs in text file when using java.util.logging.Logger
body: <p>I have a situation in which I want to write all logs created by me into a text file.</p>
  
  <p>We are using java.util.logging.Logger API to generate the logs.</p>
  
  <p>I tried:</p>
  
  <pre><code>private static Logger logger = Logger.getLogger(className.class.getName());
  FileHandler fh;   
  fh = new FileHandler("C:/className.log");   
  logger.addHandler(fh); 
  </code></pre>
  
  <p>But still getting my logs on console only.... </p>