title: logger and FileHandler in java
body: <p>I want to print date and time in file not in the Screen</p>
  
  <p>this is my code:              </p>
  
  <pre><code>String fileName =  NameEnter.getText(); 
  Logger logger = Logger.getLogger("puzzleNumberGame.securityScreen");  
  FileHandler fh = new FileHandler(fileName);
  logger.addHandler(fh);
  logger.setLevel(Level.ALL);
  SimpleFormatter formatter = new SimpleFormatter();
  fh.setFormatter(formatter);
  logger.log(Level.WARNING,"My first log");
  </code></pre>
  
  <p>I use this</p>
  
  <pre><code>// handlers = java.util.logging.ConsoleHandler;
  </code></pre>
  
  <p>but it is not working 
  Thanks for all :)</p>