|
From: <kc...@us...> - 2003-05-27 03:03:11
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv31435/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Constants.java Utility.java
Log Message:
added external configuration for log4j
Index: Constants.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Constants.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Constants.java 13 May 2003 04:28:56 -0000 1.26
--- Constants.java 27 May 2003 03:03:08 -0000 1.27
***************
*** 237,242 ****
* Path to access the logger used in configuration file.
*/
! public static final String PROPERTY_USE_LOGGER =
! "MSH/Log/UseLogger";
/**
--- 237,242 ----
* Path to access the logger used in configuration file.
*/
! public static final String PROPERTY_EXTERNAL_LOGGER_CONFIG =
! "MSH/Log/ExternalProperties";
/**
***************
*** 386,391 ****
*/
! public static final String PROPERTY_REQUEST_USE_LOGGER =
! "Request/Log/UseLogger";
public static final String PROPERTY_REQUEST_LOG_PATH =
--- 386,391 ----
*/
! public static final String PROPERTY_REQUEST_EXTERNAL_LOGGER_CONFIG =
! "Request/Log/ExternalProperties";
public static final String PROPERTY_REQUEST_LOG_PATH =
Index: Utility.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Utility.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** Utility.java 9 Apr 2003 07:48:06 -0000 1.20
--- Utility.java 27 May 2003 03:03:08 -0000 1.21
***************
*** 127,130 ****
--- 127,132 ----
private static DocumentBuilder documentBuilder = null;
+ private static boolean loggingConfigured = false;
+
// Set up message counter
private static void init() {
***************
*** 477,480 ****
--- 479,494 ----
throws InitializationException {
+ String externalProperties = prop.get(
+ Constants.PROPERTY_EXTERNAL_LOGGER_CONFIG);
+ if (externalProperties != null &&
+ (new File(externalProperties)).exists() &&
+ !loggingConfigured) {
+ System.err.println("Info: loading LOG4J properties file at "
+ + externalProperties);
+ PropertyConfigurator.configure(externalProperties);
+ loggingConfigured = true;
+ return;
+ }
+
String logPath = prop.get(Constants.PROPERTY_LOG_PATH);
String logFile = prop.get(Constants.PROPERTY_LOG_FILE);
***************
*** 487,490 ****
--- 501,516 ----
public static void configureClientLogger(Property prop, String umbrella)
throws InitializationException {
+
+ String externalProperties = prop.get(
+ Constants.PROPERTY_REQUEST_EXTERNAL_LOGGER_CONFIG);
+ if (externalProperties != null &&
+ (new File(externalProperties)).exists() &&
+ !loggingConfigured) {
+ System.err.println("Info: loading LOG4J properties file at "
+ + externalProperties);
+ PropertyConfigurator.configure(externalProperties);
+ loggingConfigured = true;
+ return;
+ }
String logPath = prop.get(Constants.PROPERTY_REQUEST_LOG_PATH);
|