|
|
@ -50,35 +50,35 @@ import java.lang.reflect.InvocationTargetException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A logging framework wrapper that supports java.util.logging and log4j. |
|
|
|
* A logging framework wrapper that supports java.util.logging and log4j. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* Logger hierarchies are stored at the Class level. |
|
|
|
* Logger hierarchies are stored at the Class level. |
|
|
|
* Log4j will be used if the Log4j system (not necessarily config files) are |
|
|
|
* Log4j will be used if the Log4j system (not necessarily config files) are |
|
|
|
* found in the runtime classpath. |
|
|
|
* found in the runtime classpath. |
|
|
|
* Otherwise, java.util.logging will be used. |
|
|
|
* Otherwise, java.util.logging will be used. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* This is pretty safe because for use cases where multiple hierarchies |
|
|
|
* This is pretty safe because for use cases where multiple hierarchies |
|
|
|
* are desired, classloader hierarchies will effectively isolate multiple |
|
|
|
* are desired, classloader hierarchies will effectively isolate multiple |
|
|
|
* class-level Logger hierarchies. |
|
|
|
* class-level Logger hierarchies. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* Sad as it is, the java.util.logging facility lacks the most basic |
|
|
|
* Sad as it is, the java.util.logging facility lacks the most basic |
|
|
|
* developer-side and configuration-side capabilities. |
|
|
|
* developer-side and configuration-side capabilities. |
|
|
|
* Besides having a non-scalable discovery system, the designers didn't |
|
|
|
* Besides having a non-scalable discovery system, the designers didn't |
|
|
|
* comprehend the need for a level between WARNING and SEVERE! |
|
|
|
* comprehend the need for a level between WARNING and SEVERE! |
|
|
|
* Since we don't want to require log4j in Classpath, we have to live |
|
|
|
* Since we don't want to require log4j in Classpath, we have to live |
|
|
|
* with these constraints. |
|
|
|
* with these constraints. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* As with all the popular logging frameworks, if you want to capture a |
|
|
|
* As with all the popular logging frameworks, if you want to capture a |
|
|
|
* stack trace, you must use the two-parameters logging methods. |
|
|
|
* stack trace, you must use the two-parameters logging methods. |
|
|
|
* I.e., you must also pass a String, or only toString() from your |
|
|
|
* I.e., you must also pass a String, or only toString() from your |
|
|
|
* throwable will be captured. |
|
|
|
* throwable will be captured. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* Usage example:<CODE><PRE> |
|
|
|
* Usage example:<CODE><PRE> |
|
|
|
* private static FrameworkLogger logger = |
|
|
|
* private static FrameworkLogger logger = |
|
|
|
* FrameworkLogger.getLog(SqlTool.class); |
|
|
|
* FrameworkLogger.getLog(SqlTool.class); |
|
|
|
* ... |
|
|
|
* ... |
|
|
|
* logger.finer("Doing something log-worthy"); |
|
|
|
* logger.finer("Doing something log-worthy"); |
|
|
|
* </PRE> </CODE> |
|
|
|
* </PRE> </CODE> |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p/> |
|
|
|
* <p/> |
|
|
|
* The system level property <code>hsqldb.reconfig_logging=false</code> is |
|
|
|
* The system level property <code>hsqldb.reconfig_logging=false</code> is |
|
|
|
* required to avoid configuration of java.util.logging. Otherwise |
|
|
|
* required to avoid configuration of java.util.logging. Otherwise |
|
|
@ -131,7 +131,8 @@ public class FrameworkLogger { |
|
|
|
static { |
|
|
|
static { |
|
|
|
try { |
|
|
|
try { |
|
|
|
reconfigure(); |
|
|
|
reconfigure(); |
|
|
|
} catch (SecurityException e) {} |
|
|
|
} catch (SecurityException e) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -412,7 +413,7 @@ public class FrameworkLogger { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* User's entry-point into this logging system. |
|
|
|
* User's entry-point into this logging system. |
|
|
|
* <P/> |
|
|
|
* <p/> |
|
|
|
* You normally want to work with static (class-level) pointers to |
|
|
|
* You normally want to work with static (class-level) pointers to |
|
|
|
* logger instances, for performance efficiency. |
|
|
|
* logger instances, for performance efficiency. |
|
|
|
* See the class-level JavaDoc for a usage example. |
|
|
|
* See the class-level JavaDoc for a usage example. |
|
|
@ -679,7 +680,7 @@ public class FrameworkLogger { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Whether this JVM is configured with java.util.logging defaults. |
|
|
|
* Whether this JVM is configured with java.util.logging defaults. |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* If the JRE-provided config file is not in the expected place, then |
|
|
|
* If the JRE-provided config file is not in the expected place, then |
|
|
|
* we return false. |
|
|
|
* we return false. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|