1

I'm using the java.util.logging framework in java build 1.8.0_11-b12 64-bit and have some issues:

It seems like the behaviour of my logs has changed. The log file pattern log%g.log is defined in the logging.properties file. Before, the most recent logs had the lowest generation number, i.e. with the following log files:

  • log0.log <-- most recent log file
  • log1.log
  • log2.log <-- oldest log file

So, log files were shifted everytime I started a new log. This is the behavior I want

However, "recently", I don't know whether this has changed due to a Java update or anything external, this behavior has changed to:

  • log0.log <-- oldest log file
  • log1.log
  • log2.log <-- most recent log file

so, newer log files are just added with an incremented log number. Anyone got an idea what could have caused the logging framework to change behavior like this? Nothing ob

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

SOLVED After troubleshooting this issue for a day I came to the conclusion that if there are old *.log.lck files in the log directory, they mess up the generation counter. One solution is to clean the log directory of files named *lck before starting the application. And of course, to try to close the log files when stopping the application (which can be harder since my application sometimes stops because of the user pulling the Cable from the electrical outlet :-) )

  • [FileHander behavior 1.8.0_11-b12 64-bit is broken](http://stackoverflow.com/questions/24321098/is-java-util-logging-filehandler-in-java-8-broken/24327826#24327826) – jmehrens Apr 04 '17 at 17:30