1
0

Prefixed all diagnostic content during LogFactory implementation discovery by [LOOKUP]. This should make it easier for users to link the content together when they analyse the logs.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@377194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Burrell Donkin
2006-02-12 15:41:38 +00:00
parent 22aaea10a4
commit 42266eebbf

View File

@@ -396,7 +396,7 @@ public abstract class LogFactory {
} }
logDiagnostic( logDiagnostic(
"LogFactory implementation requested for the first time for context classloader " "[LOOKUP] LogFactory implementation requested for the first time for context classloader "
+ objectId(contextClassLoader)); + objectId(contextClassLoader));
// Load properties file. // Load properties file.
@@ -435,24 +435,24 @@ public abstract class LogFactory {
// Determine which concrete LogFactory subclass to use. // Determine which concrete LogFactory subclass to use.
// First, try a global system property // First, try a global system property
logDiagnostic( logDiagnostic(
"Looking for system property [" + FACTORY_PROPERTY "[LOOKUP] Looking for system property [" + FACTORY_PROPERTY
+ "] to define the LogFactory subclass to use.."); + "] to define the LogFactory subclass to use...");
try { try {
String factoryClass = System.getProperty(FACTORY_PROPERTY); String factoryClass = System.getProperty(FACTORY_PROPERTY);
if (factoryClass != null) { if (factoryClass != null) {
logDiagnostic( logDiagnostic(
"Creating an instance of LogFactory class " + factoryClass "[LOOKUP] Creating an instance of LogFactory class '" + factoryClass
+ " as specified by system property " + FACTORY_PROPERTY); + "' as specified by system property " + FACTORY_PROPERTY);
factory = newFactory(factoryClass, baseClassLoader, contextClassLoader); factory = newFactory(factoryClass, baseClassLoader, contextClassLoader);
} }
} catch (SecurityException e) { } catch (SecurityException e) {
logDiagnostic( logDiagnostic(
"A security exception occurred while trying to create an" "[LOOKUP] A security exception occurred while trying to create an"
+ " instance of the custom factory class" + " instance of the custom factory class"
+ ": [" + e.getMessage().trim() + ": [" + e.getMessage().trim()
+ "]. Trying alternative implementations.."); + "]. Trying alternative implementations...");
; // ignore ; // ignore
} }
@@ -465,8 +465,8 @@ public abstract class LogFactory {
if (factory == null) { if (factory == null) {
logDiagnostic( logDiagnostic(
"Looking for a resource file of name [" + SERVICE_ID "[LOOKUP] Looking for a resource file of name [" + SERVICE_ID
+ "] to define the LogFactory subclass to use.."); + "] to define the LogFactory subclass to use...");
try { try {
InputStream is = getResourceAsStream(contextClassLoader, InputStream is = getResourceAsStream(contextClassLoader,
@@ -489,9 +489,9 @@ public abstract class LogFactory {
! "".equals(factoryClassName)) { ! "".equals(factoryClassName)) {
logDiagnostic( logDiagnostic(
"Creating an instance of LogFactory class " + factoryClassName "[LOOKUP] Creating an instance of LogFactory class " + factoryClassName
+ " as specified by file " + SERVICE_ID + " as specified by file '" + SERVICE_ID
+ " which was present in the path of the context" + "' which was present in the path of the context"
+ " classloader."); + " classloader.");
factory = newFactory(factoryClassName, baseClassLoader, contextClassLoader ); factory = newFactory(factoryClassName, baseClassLoader, contextClassLoader );
@@ -499,10 +499,10 @@ public abstract class LogFactory {
} }
} catch( Exception ex ) { } catch( Exception ex ) {
logDiagnostic( logDiagnostic(
"A security exception occurred while trying to create an" "[LOOKUP] A security exception occurred while trying to create an"
+ " instance of the custom factory class" + " instance of the custom factory class"
+ ": [" + ex.getMessage().trim() + ": [" + ex.getMessage().trim()
+ "]. Trying alternative implementations.."); + "]. Trying alternative implementations...");
; // ignore ; // ignore
} }
@@ -519,14 +519,14 @@ public abstract class LogFactory {
if (factory == null) { if (factory == null) {
logDiagnostic( logDiagnostic(
"Looking for a properties file of name " + FACTORY_PROPERTIES "[LOOKUP] Looking for a properties file of name '" + FACTORY_PROPERTIES
+ " to define the LogFactory subclass to use.."); + "' to define the LogFactory subclass to use...");
if (props != null) { if (props != null) {
logDiagnostic( logDiagnostic(
"Properties file found. Looking for property " "[LOOKUP] Properties file found. Looking for property '"
+ FACTORY_PROPERTY + FACTORY_PROPERTY
+ " to define the LogFactory subclass to use.."); + "' to define the LogFactory subclass to use...");
String factoryClass = props.getProperty(FACTORY_PROPERTY); String factoryClass = props.getProperty(FACTORY_PROPERTY);
if (factoryClass != null) { if (factoryClass != null) {
@@ -542,8 +542,8 @@ public abstract class LogFactory {
if (factory == null) { if (factory == null) {
logDiagnostic( logDiagnostic(
"Loading the default LogFactory implementation " + FACTORY_DEFAULT "[LOOKUP] Loading the default LogFactory implementation '" + FACTORY_DEFAULT
+ " via the same classloader that loaded this LogFactory" + "' via the same classloader that loaded this LogFactory"
+ " class (ie not looking in the context classloader)."); + " class (ie not looking in the context classloader).");
// Note: unlike the above code which can try to load custom LogFactory // Note: unlike the above code which can try to load custom LogFactory