0 Replies Latest reply on Mar 10, 2011 3:19 AM by 846227

    Java logging problem in 1.4


      Currently I am using java.util.logging (1.4) in my project running on Websphere App Server v6.1.
      I am facing a problem where many empty *.log.n & also *.lck will be generated automatically when running the program.
      I hv checked and found that the problem is due to the handlers are not closed properly in the API, is that true? And also, I know that the problem has been resolved in 1.5, but I still facing the same problem even I tried on it. I hv also heard that it can be resolved by creating a Singleton Logger, so that it will always generate only one *.log as well as *.lck. Is there any example code can be referred if it is true. Pls kindly see my code snippet as below for further understanding.

      In Java Class
      private static final Logger logger = Logger.getLogger("com.xxx.yyyy");

      In Servlet Class

      In logging.properties file
      com.xxx.yyyy.handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

      java.util.logging.FileHandler.pattern = C:/log/test.log
      java.util.logging.FileHandler.limit = 500000
      java.util.logging.FileHandler.count = 1
      java.util.logging.FileHandler.level = INFO
      java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

      java.util.logging.ConsoleHandler.level = INFO
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

      com.xxx.yyyy.level = INFO

      Hope above the details are enough for the understanding and looks forward for the feedback.

      Thank you.