db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <to...@first.gmd.de>
Subject [ANN] Separation of logging and OJB properties
Date Tue, 01 Jun 2004 21:45:04 GMT
I've modified logging and OJB configuration so that they are now
independent of each other. This means that initialization of logging
*won't* initialize OJB. Instead, logging properties are moved to a new
properties file, OJB-logging.properties. The main reason for this is to
allow OJB to be completely configurable at runtime (which I'll tackle
next). Logging prevented this because the first log request resulted in
configuration of OJB from OJB.properties.

The initialization of logging is now as follows:

* check whether system properties
'org.apache.ojb.broker.util.logging.Logger.class'/'LoggerClass' (new
name/old but still supported name) and
'org.apache.ojb.broker.util.logging.Logger.configFile'/'LoggerConfigFile'
are set

* if not, try to load the resource OJB-logging.properties (different name
can be set via system property 'OJB-logging.properties')

* if this file is not present, try to load the resource OJB.properties
(for backwards compatibility, different name can be set via system
property 'OJB.properties')

* if this file is also not present, check whether the system property for
the commons-logging LogFactory 'org.apache.commons.logging.LogFactory' is
set

* if not, check whether a log4j.properties is present; if so use
Log4JLoggerImpl

* if not, use commons-logging (which will default to simplelog if no
'commons-logging.properties' file is present)

I tried to make the changes be as backward compatible as possible. The
only API change that I had to make is that LoggingConfiguration is no
longer an interface that is implemented by OjbConfiguration, but rather a
separated Configuration implementation that loads itself. This should not
affect custom Logger implementations, though, except if they assume that
the configuration object they receive contains the complete OJB
configuration (which they shouldn't anyway).

I've tested the changes with the unit tests with PoorMansLoggerImpl,
Log4JLoggerImpl, and CommonsLoggerImpl, and they all work as expected.
I'll also add reference documentation concerning the logging later this
week.

Please, test the changes and post any problems.

thanks,
Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message