FULL PRODUCT VERSION :
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
A logger (with name "com.foo.testing") is defined in the logging properties file. The child logger (with name "com.foo.testing.logging.Logging3") is used inside the source.
During execution, there are 4 files (log, log.lck, log.1 and log.lck), but after the program exits, just log.lck is removed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. define a logger in logging properties
2. use Logger.getLogger to get a child logger
3. the unwanted lock file remained
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
only one file "log" after program execution
ACTUAL -
log, log.1 and log.1.lck, 3 files remain
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
logging properties :
com.foo.testing.handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
source :
package com.foo.testing.logging;
import java.util.logging.Handler;
import java.util.logging.Logger;
public class Logging3 {
public static void main(String[] args) {
Logging3 mainObj = new Logging3();
mainObj.execute();
}
private void clean(Logger logger) {
if (logger != null) {
for (Handler handler : logger.getHandlers()) {
handler.close();
}
clean(logger.getParent());
}
}
private void execute() {
Logger logger = Logger.getLogger(Logging3.class.getName());
logger.info("hello world");
clean(logger);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Delete unnecessary files explicitly
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
A logger (with name "com.foo.testing") is defined in the logging properties file. The child logger (with name "com.foo.testing.logging.Logging3") is used inside the source.
During execution, there are 4 files (log, log.lck, log.1 and log.lck), but after the program exits, just log.lck is removed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. define a logger in logging properties
2. use Logger.getLogger to get a child logger
3. the unwanted lock file remained
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
only one file "log" after program execution
ACTUAL -
log, log.1 and log.1.lck, 3 files remain
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
logging properties :
com.foo.testing.handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
source :
package com.foo.testing.logging;
import java.util.logging.Handler;
import java.util.logging.Logger;
public class Logging3 {
public static void main(String[] args) {
Logging3 mainObj = new Logging3();
mainObj.execute();
}
private void clean(Logger logger) {
if (logger != null) {
for (Handler handler : logger.getHandlers()) {
handler.close();
}
clean(logger.getParent());
}
}
private void execute() {
Logger logger = Logger.getLogger(Logging3.class.getName());
logger.info("hello world");
clean(logger);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Delete unnecessary files explicitly
- relates to
-
JDK-8048020 Regression on java.util.logging.FileHandler
-
- Closed
-
-
JDK-8060132 Handlers configured on abstract nodes in logging.properties are not always properly closed
-
- Closed
-