dirkv 01/08/13 06:55:38
Modified: src/share/org/apache/slide/common Domain.java
Log:
use domain log channel
log stacktraces
Revision Changes Path
1.27 +25 -24 jakarta-slide/src/share/org/apache/slide/common/Domain.java
Index: Domain.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Domain.java 2001/08/06 11:27:54 1.26
+++ Domain.java 2001/08/13 13:55:38 1.27
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
1.26 2001/08/06 11:27:54 cmlenz Exp $
- * $Revision: 1.26 $
- * $Date: 2001/08/06 11:27:54 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
1.27 2001/08/13 13:55:38 dirkv Exp $
+ * $Revision: 1.27 $
+ * $Date: 2001/08/13 13:55:38 $
*
* ====================================================================
*
@@ -90,11 +90,12 @@
* For now, does not implement access control on Namespaces.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
*/
public final class Domain {
+
+ private final static String LOG_CHANNEL = Domain.class.getName();
-
// ----------------------------------------------------- Instance Variables
@@ -337,7 +338,7 @@
logger.setLoggerLevel(configuration.getAttributeAsInt
("logger-level", Logger.INFO));
} catch (Exception e) {
- e.printStackTrace();
+ error(e);
throw new DomainInitializationFailedError
("Logger Problem: " + e.toString());
}
@@ -394,7 +395,7 @@
* @param level The level used for logging.
*/
public static void log(Object data, int level) {
- logger.log(data, level);
+ logger.log(data,LOG_CHANNEL, level);
}
@@ -404,7 +405,7 @@
* @param data The object to log.
*/
public static void log(Object data) {
- logger.log(data);
+ logger.log(data,LOG_CHANNEL,Logger.DEBUG);
}
@@ -414,7 +415,7 @@
* @param data The object to log
*/
public static void debug(Object data) {
- log(data, Logger.DEBUG);
+ log(data,LOG_CHANNEL, Logger.DEBUG);
}
@@ -424,7 +425,7 @@
* @param data The object to log
*/
public static void error(Object data) {
- log(data, Logger.ERROR);
+ log(data,LOG_CHANNEL, Logger.ERROR);
}
@@ -435,8 +436,8 @@
* @param t Throwable object
*/
public static void error(Object data, Throwable t) {
- log(data + " - " + t.getMessage(), Logger.ERROR);
- t.printStackTrace();
+ log(data + " - " + t.getMessage(),LOG_CHANNEL, Logger.ERROR);
+ log(t,LOG_CHANNEL, Logger.ERROR);
}
@@ -446,7 +447,7 @@
* @param data The object to log
*/
public static void info(Object data) {
- log(data, Logger.INFO);
+ log(data,LOG_CHANNEL, Logger.INFO);
}
@@ -456,7 +457,7 @@
* @param data The object to log
*/
public static void warn(Object data) {
- log(data, Logger.WARNING);
+ log(data,LOG_CHANNEL, Logger.WARNING);
}
@@ -479,7 +480,7 @@
* @param level The level specification
*/
public static boolean isEnabled(int level) {
- return logger.isEnabled(level);
+ return logger.isEnabled(LOG_CHANNEL,level);
}
@@ -488,7 +489,7 @@
* logging.
*/
public static boolean isDebugEnabled() {
- return isEnabled(logger.DEBUG);
+ return isEnabled(LOG_CHANNEL,logger.DEBUG);
}
@@ -497,7 +498,7 @@
* logging.
*/
public static boolean isWarningEnabled() {
- return isEnabled(logger.WARNING);
+ return isEnabled(LOG_CHANNEL,logger.WARNING);
}
@@ -505,7 +506,7 @@
* Check if the default channel with the INFO level is enabled for logging.
*/
public static boolean isInfoEnabled() {
- return isEnabled(logger.INFO);
+ return isEnabled(LOG_CHANNEL,logger.INFO);
}
@@ -514,7 +515,7 @@
* logging.
*/
public static boolean isErrorEnabled() {
- return isEnabled(logger.ERROR);
+ return isEnabled(LOG_CHANNEL,logger.ERROR);
}
@@ -598,7 +599,7 @@
logger.setLoggerLevel(Logger.INFO);
}
catch (Exception e) {
- e.printStackTrace();
+ error(e);
throw new DomainInitializationFailedError
("Logger Problem: " + e.toString());
}
@@ -662,7 +663,7 @@
info("Initializing namespace : "
+ configuration.getAttribute("name"));
} catch (ConfigurationException e) {
- e.printStackTrace();
+ error(e);
}
String loggerClass = configuration.getAttribute
@@ -681,7 +682,7 @@
namespaceLogger.setLoggerLevel(configuration.getAttributeAsInt
("logger-level", Logger.INFO));
} catch (Exception e) {
- e.printStackTrace();
+ error(e);
}
}
Configuration namespaceDefinition =
@@ -732,7 +733,7 @@
// silently ignore it ==> no services
}
catch (Exception e){
- e.printStackTrace();
+ error(e);
}
// preparation to add services, please ignore now
@@ -741,7 +742,7 @@
info("Namespace configuration complete");
} catch (Throwable t) {
- t.printStackTrace();
+ error(t);
}
}