-
Bug
-
Resolution: Fixed
-
P3
-
7u11
-
b88
-
x86_64
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142156 | emb-9 | Daniel Fuchs | P3 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
The java.util.logging.LogManager#readConfiguration(InputStream) method has a flaw, which I found by debugging through the JDK Code because I missed log messages. It does not reinitialize the logging system properly.
What I found (maybe there is more) is, that it does not load per-logger handlers and does not reset / set the useParentHandlers property. readConfiguration first resets all loggers, removing the handlers amongst other things and then forgets to check for per-logger handlers. Because of that any messages sent to per-logger handlers are lost. And if you switched off useParentHandlers on a log level and call readConfiguration, the messages are of course swalled completely.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
You find two examples for reproducing the issue at http://stackoverflow.com/questions/16441467/use-of-readconfiguration-method-in-logging-activities where also my (Vampire) answer is added.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Either
- Do not use per-logger handlers in your log configuration file
- Do not call readConfiguration() or readConfiguration(InputStream), but store the configuration in a file and load it on JVM startup
- Configure your logging through API calls
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
The java.util.logging.LogManager#readConfiguration(InputStream) method has a flaw, which I found by debugging through the JDK Code because I missed log messages. It does not reinitialize the logging system properly.
What I found (maybe there is more) is, that it does not load per-logger handlers and does not reset / set the useParentHandlers property. readConfiguration first resets all loggers, removing the handlers amongst other things and then forgets to check for per-logger handlers. Because of that any messages sent to per-logger handlers are lost. And if you switched off useParentHandlers on a log level and call readConfiguration, the messages are of course swalled completely.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
You find two examples for reproducing the issue at http://stackoverflow.com/questions/16441467/use-of-readconfiguration-method-in-logging-activities where also my (Vampire) answer is added.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Either
- Do not use per-logger handlers in your log configuration file
- Do not call readConfiguration() or readConfiguration(InputStream), but store the configuration in a file and load it on JVM startup
- Configure your logging through API calls
- backported by
-
JDK-8142156 readConfiguration does not cleanly reinitialize the logging system
-
- Resolved
-
- relates to
-
JDK-8191033 Regression in logging.properties: specifying .handlers= for root logger (instead of handlers=) no longer works
-
- Closed
-
-
JDK-8146665 Test jdk/test/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java fails - missing expected output
-
- Closed
-