harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura" <stepan.mish...@gmail.com>
Subject Re: [classlib][logging] a test suite shouldn't touch any of JRE config files!!!
Date Mon, 04 Sep 2006 09:47:11 GMT
On 9/1/06, Paulex Yang wrote:
>
> 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.


Do you mean that RI resets the root logger's level of customized LogManager
to default value from "lib/logging.properties"?

Thanks,
Stepan.

>
> > 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: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message