Stepan Mishura wrote:
Hi Andrew,
I've just looked into static initialization block and then to the
spec. for
LogManager class.
My impression is that Harmony implementation doesn't follow the spec.
The spec. says: "At startup the LogManager class is located using the '
java.util.logging.manager' system property.By default, the LogManager
reads
its initial configuration from a properties file
"lib/logging.properties" in
the JRE directory...."
Stepan,
I think the meaning of "By default" is debatable. Actually the spec
looks like this:
"At startup the LogManager class is located using the
java.util.logging.manager system property.
By default, the LogManager reads its initial configuration from a
properties file "lib/logging.properties" in the JRE directory. If you
edit that property file you can change the default logging configuration
for all uses of that JRE.
In addition, the LogManager uses two optional system properties that
allow more control over reading the initial configuration:
* "java.util.logging.config.class"
* "java.util.logging.config.file"...
"
So I consider the "By default" doesn't necessarily means default case
without "java.util.logging.manager" property, but means the default case
without "java.util.logging.config.class/file" properties.
A simple test on RI of specifying a customized MockLogManager by
"j.u.l.manager" property shows the default "lib/logging.properties" does
affect the behavior of the customized LogManager, say the root logger's
level, etc.
So if the property 'java.util.logging.manager' is not set a default
implementation is used. The default implementation looks for '
java.util.logging.config.class' and 'java.util.logging.config.file'
system
properties, reads config from 'jre/lib/logging.properties' and so on.
If the mentioned property is set then a custom LogManager class
implementation is used. And it is up to the custom implementation how to
load configuration. Right?
But Harmony implementation follows default initialization procedure in
any
case. It loads the custom LogManager, looks for '
java.util.logging.config.class' and 'java.util.logging.config.file'
system
properties and if none of them are set and it forces the custom
LogManager to read properties from 'jre/lib/logging.properties' file.
Why?
It is up to the custom implementation whether to read it or not.
Did I missed something?
Thanks,
Stepan.
<SNIP>
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Paulex Yang
China Software Development Lab
IBM
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]