title: Java Logger FileHandler naming convention
body: <p>I have a servlet deployed. I am a little confused about the log files being generated. particularly i am not sure which one to look at. </p>
  
  <p>There are several generated with the same data.</p>
  
  <p>I am using the following code to initialize my Filehandler.</p>
  
  <pre><code>Logger logger = Logger.getLogger(Global.TAG);
  String path = realPath + "myappname" + ".%g.log";
  FileHandler fh = new FileHandler(path, 10240000, 1000, true);
  logger.addHandler(fh);
  logger.setLevel(Level.ALL);
  SimpleFormatter formatter = new SimpleFormatter();
  fh.setFormatter(formatter);
  logInfo("Logger Configured!");
  </code></pre>
  
  <p>Notice that i have <code>%g</code> in there for when files are rotated.</p>
  
  <p>The files generated are something like this.</p>
  
  <pre><code>myappname.0.log
  myappname.0.log.1
  myappname.0.log.2
  myappname.0.log.3
  myappname.0.log.4
  myappname.0.log.5
  myappname.0.log.6
  myappname.1.log
  myappname.1.log.2
  myappname.1.log.4
  myappname.1.log.5
  myappname.2.log
  myappname.2.log.1
  myappname.2.log.2
  myappname.2.log.3
  myappname.2.log.4
  myappname.2.log.5
  myappname.2.log.6
  myappname.3.log
  myappname.3.log.1
  myappname.3.log.3
  myappname.3.log.6
  </code></pre>
  
  <p>The servlet was undeployed and redeployed several times in the last 2-3 weeks in which the logs were generated.</p>
  
  <p>What i have noticed is that logs with the same name (except the last bit after the ".log" part) have the same logging statements. Some files have more and some less.</p>
  
  <p>What gives? How should i be reading this?</p>