You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Tang Yanjun (JIRA)" <ji...@apache.org> on 2005/07/15 08:26:28 UTC
[jira] Created: (OJB-60) when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
--------------------------------------------------------------------------------------------------------------------------------------
Key: OJB-60
URL: http://issues.apache.org/jira/browse/OJB-60
Project: OJB
Type: Bug
Versions: 1.0.3
Environment: windows 2000
jdk 1.4.2_08
tomcat 5.0.18
Reporter: Tang Yanjun
Just put "commons-logging.properties" under the WEB-INF/classes. no "OJB-logging.properties"
The Ojb BOOT log will output:
[BOOT] DEBUG: Instantiate PersistenceBrokerFactory
[BOOT] INFO: Loading OJB's properties from file file:/F:/My%20WorkSpace/Apache/Tomcat-5.0.18/webapps/empty/WEB-INF/classes/OJB.properties
[BOOT] DEBUG: No value for key "ObjectCacheClass", using default org.apache.ojb.broker.cache.ObjectCacheDefaultImpl.
[BOOT] INFO: Logging: Found 'commons-logging.properties' file, use class org.apache.ojb.broker.util.logging.CommonsLoggerImpl
[BOOT] INFO: ** Can't find logging configuration file, use default logger **
This mean the Obj can find the "commons-logging.properties", but it doesn't use it, it also use the "Poor Mans Logging".
I see the source code for class "org.apache.ojb.broker.util.logging.LoggingConfiguration" and I find the problem:
if (_loggerClass == null)
{
// or a commons-logging.properties file ?
try
{
ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
if (ojbLogPropFile != null)
{
// yep, so use commons-logging
_loggerClass = CommonsLoggerImpl.class;
_loggerConfigFile = "commons-logging.properties";
bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
ojbLogPropFile.close();
}
}
catch (Exception ex)
{}
// no, so default to poor man's logging
----->>> bootLogger.info("** Can't find logging configuration file, use default logger **");
----->>> _loggerClass = PoorMansLoggerImpl.class;
}
I think the right code should be:
if (_loggerClass == null)
{
// or a commons-logging.properties file ?
try
{
ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
if (ojbLogPropFile != null)
{
// yep, so use commons-logging
_loggerClass = CommonsLoggerImpl.class;
_loggerConfigFile = "commons-logging.properties";
bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
ojbLogPropFile.close();
}
}
catch (Exception ex)
{}
}
if (_loggerClass == null){
// no, so default to poor man's logging
bootLogger.info("** Can't find logging configuration file, use default logger **");
_loggerClass = PoorMansLoggerImpl.class;
}
right?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
[jira] Resolved: (OJB-60) when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/OJB-60?page=all ]
Thomas Dudziak resolved OJB-60:
-------------------------------
Fix Version: 1.0.x CVS
1.1 CVS
Resolution: Fixed
Fixed as per your suggestion.
> when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OJB-60
> URL: http://issues.apache.org/jira/browse/OJB-60
> Project: OJB
> Type: Bug
> Versions: 1.0.3
> Environment: windows 2000
> jdk 1.4.2_08
> tomcat 5.0.18
> Reporter: Tang Yanjun
> Assignee: Thomas Dudziak
> Fix For: 1.0.x CVS, 1.1 CVS
>
> Just put "commons-logging.properties" under the WEB-INF/classes. no "OJB-logging.properties"
> The Ojb BOOT log will output:
> [BOOT] DEBUG: Instantiate PersistenceBrokerFactory
> [BOOT] INFO: Loading OJB's properties from file file:/F:/My%20WorkSpace/Apache/Tomcat-5.0.18/webapps/empty/WEB-INF/classes/OJB.properties
> [BOOT] DEBUG: No value for key "ObjectCacheClass", using default org.apache.ojb.broker.cache.ObjectCacheDefaultImpl.
> [BOOT] INFO: Logging: Found 'commons-logging.properties' file, use class org.apache.ojb.broker.util.logging.CommonsLoggerImpl
> [BOOT] INFO: ** Can't find logging configuration file, use default logger **
> This mean the Obj can find the "commons-logging.properties", but it doesn't use it, it also use the "Poor Mans Logging".
> I see the source code for class "org.apache.ojb.broker.util.logging.LoggingConfiguration" and I find the problem:
> if (_loggerClass == null)
> {
> // or a commons-logging.properties file ?
> try
> {
> ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
> if (ojbLogPropFile != null)
> {
> // yep, so use commons-logging
> _loggerClass = CommonsLoggerImpl.class;
> _loggerConfigFile = "commons-logging.properties";
> bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
> ojbLogPropFile.close();
> }
> }
> catch (Exception ex)
> {}
> // no, so default to poor man's logging
> ----->>> bootLogger.info("** Can't find logging configuration file, use default logger **");
> ----->>> _loggerClass = PoorMansLoggerImpl.class;
> }
> I think the right code should be:
> if (_loggerClass == null)
> {
> // or a commons-logging.properties file ?
> try
> {
> ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
> if (ojbLogPropFile != null)
> {
> // yep, so use commons-logging
> _loggerClass = CommonsLoggerImpl.class;
> _loggerConfigFile = "commons-logging.properties";
> bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
> ojbLogPropFile.close();
> }
> }
> catch (Exception ex)
> {}
> }
> if (_loggerClass == null){
> // no, so default to poor man's logging
> bootLogger.info("** Can't find logging configuration file, use default logger **");
> _loggerClass = PoorMansLoggerImpl.class;
> }
> right?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
[jira] Assigned: (OJB-60) when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/OJB-60?page=all ]
Thomas Dudziak reassigned OJB-60:
---------------------------------
Assign To: Thomas Dudziak
> when use the common-logging.properties, the system can find the common-logging.properties, but aslo use the default "Poor Man Logging"
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OJB-60
> URL: http://issues.apache.org/jira/browse/OJB-60
> Project: OJB
> Type: Bug
> Versions: 1.0.3
> Environment: windows 2000
> jdk 1.4.2_08
> tomcat 5.0.18
> Reporter: Tang Yanjun
> Assignee: Thomas Dudziak
> Fix For: 1.0.x CVS, 1.1 CVS
>
> Just put "commons-logging.properties" under the WEB-INF/classes. no "OJB-logging.properties"
> The Ojb BOOT log will output:
> [BOOT] DEBUG: Instantiate PersistenceBrokerFactory
> [BOOT] INFO: Loading OJB's properties from file file:/F:/My%20WorkSpace/Apache/Tomcat-5.0.18/webapps/empty/WEB-INF/classes/OJB.properties
> [BOOT] DEBUG: No value for key "ObjectCacheClass", using default org.apache.ojb.broker.cache.ObjectCacheDefaultImpl.
> [BOOT] INFO: Logging: Found 'commons-logging.properties' file, use class org.apache.ojb.broker.util.logging.CommonsLoggerImpl
> [BOOT] INFO: ** Can't find logging configuration file, use default logger **
> This mean the Obj can find the "commons-logging.properties", but it doesn't use it, it also use the "Poor Mans Logging".
> I see the source code for class "org.apache.ojb.broker.util.logging.LoggingConfiguration" and I find the problem:
> if (_loggerClass == null)
> {
> // or a commons-logging.properties file ?
> try
> {
> ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
> if (ojbLogPropFile != null)
> {
> // yep, so use commons-logging
> _loggerClass = CommonsLoggerImpl.class;
> _loggerConfigFile = "commons-logging.properties";
> bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
> ojbLogPropFile.close();
> }
> }
> catch (Exception ex)
> {}
> // no, so default to poor man's logging
> ----->>> bootLogger.info("** Can't find logging configuration file, use default logger **");
> ----->>> _loggerClass = PoorMansLoggerImpl.class;
> }
> I think the right code should be:
> if (_loggerClass == null)
> {
> // or a commons-logging.properties file ?
> try
> {
> ojbLogPropFile = contextLoader.getResourceAsStream("commons-logging.properties");
> if (ojbLogPropFile != null)
> {
> // yep, so use commons-logging
> _loggerClass = CommonsLoggerImpl.class;
> _loggerConfigFile = "commons-logging.properties";
> bootLogger.info("Logging: Found 'commons-logging.properties' file, use " + _loggerClass);
> ojbLogPropFile.close();
> }
> }
> catch (Exception ex)
> {}
> }
> if (_loggerClass == null){
> // no, so default to poor man's logging
> bootLogger.info("** Can't find logging configuration file, use default logger **");
> _loggerClass = PoorMansLoggerImpl.class;
> }
> right?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org