[pal-cvs 3259] [993] replaced a logging.

svnno****@sourc***** svnno****@sourc*****
2008年 6月 20日 (金) 07:26:05 JST


Revision: 993
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=993
Author:   shinsuke
Date:     2008-06-20 07:26:05 +0900 (Fri, 20 Jun 2008)

Log Message:
-----------
replaced a logging.

Modified Paths:
--------------
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
    pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java


-------------- next part --------------
Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/AbstractAuthFilter.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -31,8 +31,9 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalAuthenticationConfiguration;
@@ -88,9 +89,9 @@
         // debug
         if (log.isDebugEnabled())
         {
-            log.debug("usernameKey=" + usernameKey);
-            log.debug("passwordKey=" + passwordKey);
-            log.debug("skipPasswordCheck=" + skipPasswordCheck);
+            Object[] args = new Object[]
+            {usernameKey, passwordKey, Boolean.toString(skipPasswordCheck)};
+            log.log("0900020", args);
         }
     }
 
@@ -184,8 +185,9 @@
                     // debug
                     if (log.isDebugEnabled())
                     {
-                        log.debug("Authentication failure: username="
-                                + username);
+                        Object[] args = new Object[]
+                        {username};
+                        log.log("0900021", args);
                     }
                 }
             }

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/filter/CookieTransferFilter.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -18,8 +18,9 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.security.SecurityException;
 import org.apache.jetspeed.security.User;
@@ -102,11 +103,10 @@
         // debug
         if (log.isDebugEnabled())
         {
-            log.debug("path=" + path);
-            log.debug("domain=" + domain);
-            log.debug("maxAge=" + maxAge);
-            log.debug("secure=" + secure);
-            log.debug("transferredInfo=" + transferredInfo);
+            Object[] args = new Object[]
+            {path, domain, Integer.toString(maxAge), Boolean.toString(secure),
+                    transferredInfo};
+            log.log("0900022", args);
         }
     }
 
@@ -169,9 +169,9 @@
                         }
                         catch (SecurityException e)
                         {
-                            log.warn(
-                                    "Could not get the user info: " + username,
-                                    e);
+                            Object[] args = new Object[]
+                            {username};
+                            log.log("0900023", args);
                         }
                     }
 

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/jp/sf/pal/portal/servlet/UserManagerServlet.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -12,8 +12,9 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.security.GroupManager;
@@ -101,16 +102,16 @@
                 .getComponent("org.apache.jetspeed.security.UserManager");
         if (userManager == null)
         {
-            log.error("Could not create UserManager.");
-            throw new ServletException("Could not create UserManager.");
+            log.log("0900024"); // REPLACED
+            throw new ServletException(log.getString("0900024"));
         }
         // RoleManager
         roleManager = (RoleManager) Jetspeed.getComponentManager()
                 .getComponent("org.apache.jetspeed.security.RoleManager");
         if (roleManager == null)
         {
-            log.error("Could not create RoleManager.");
-            throw new ServletException("Could not create RoleManager.");
+            log.log("0900025"); // REPLACED
+            throw new ServletException(log.getString("0900025"));
         }
 
         // GroupManager
@@ -118,8 +119,8 @@
                 .getComponent("org.apache.jetspeed.security.GroupManager");
         if (groupManager == null)
         {
-            log.error("Could not create GroupManager.");
-            throw new ServletException("Could not create GroupManager.");
+            log.log("0900026"); // REPLACED
+            throw new ServletException(log.getString("0900026"));
         }
 
         // Profiler
@@ -127,8 +128,8 @@
                 "org.apache.jetspeed.profiler.Profiler");
         if (profiler == null)
         {
-            log.error("Could not create Profiler.");
-            throw new ServletException("Could not create Profiler.");
+            log.log("0900027"); // REPLACED
+            throw new ServletException(log.getString("0900027"));
         }
 
         // excludedUsernames
@@ -309,7 +310,7 @@
             setResponseHeader(resp);
             printResult(printWriter, SERVER_ERROR_STATUS,
                     "Could not create a user: " + e.getMessage(), null);
-            log.error("Could not create a user: " + e.getMessage(), e);
+            log.log("0900028", e); // REPLACED
             return;
         }
 
@@ -352,14 +353,14 @@
             setResponseHeader(resp);
             printResult(printWriter, SERVER_ERROR_STATUS,
                     "Could not create a user: " + e.getMessage(), null);
-            log.error("Could not create a user: " + e.getMessage(), e);
+            log.log("0900029", e); // REPLACED
             try
             {
                 userManager.removeUser(username);
             }
             catch (SecurityException e1)
             {
-                log.error("Could not remove a user: " + e1.getMessage(), e1);
+                log.log("0900030", e1); // REPLACED
             }
             return;
         }
@@ -426,7 +427,7 @@
             setResponseHeader(resp);
             printResult(printWriter, SERVER_ERROR_STATUS,
                     "Could not update a user: " + e.getMessage(), null);
-            log.error("Could not update a user: " + e.getMessage(), e);
+            log.log("0900031", e);
             return;
         }
 
@@ -475,7 +476,7 @@
             setResponseHeader(resp);
             printResult(printWriter, SERVER_ERROR_STATUS,
                     "Could not remove a user: " + e.getMessage(), null);
-            log.error("Could not remove a user: " + e.getMessage(), e);
+            log.log("0900032", e); // REPLACED
             return;
         }
     }

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -31,9 +31,10 @@
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
 
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.exception.JetspeedException;
@@ -346,20 +347,30 @@
                 }
                 catch (Exception e)
                 {
-                    log.error("Registration Error: Failed to rollback user "
-                            + userName);
+                    // log.error("Registration Error: Failed to rollback user "
+                    // + userName);
+                    Object[] args = new Object[]
+                    {userName};
+                    log.log("0900033", args); // REPLACED
                 }
-                log
-                        .error("Registration Error: Failed to create user folders for "
-                                + userName + ", " + pe.toString());
+                // log
+                // .error("Registration Error: Failed to create user folders for
+                // "
+                // + userName + ", " + pe.toString());
+                Object[] args = new Object[]
+                {userName, pe.toString()};
+                log.log("0900034", args); // REPLACED
                 throw pe;
             }
 
         }
         catch (Exception e)
         {
-            log.error("Registration Error: Failed to create registered user "
-                    + userName + ", " + e.toString());
+            // log.error("Registration Error: Failed to create registered user "
+            // + userName + ", " + e.toString());
+            Object[] args = new Object[]
+            {userName};
+            log.log("0900035", args); // REPLACED
             throw new RegistrationException(e);
         }
     }

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -21,8 +21,9 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.aggregator.CurrentWorkerContext;
 import org.apache.jetspeed.aggregator.FailedToRenderFragmentException;
@@ -136,7 +137,8 @@
             }
             catch (Exception e)
             {
-                log.error(e.getMessage(), e);
+                // log.error(e.getMessage(), e);
+                log.log("0900036", e); // REPLACED
                 maxedContentFragment
                         .overrideRenderedContent("Sorry, but we were unable access the requested portlet.  Send the following message to your portal admin:  "
                                 + e.getMessage());
@@ -212,8 +214,12 @@
 
         if (log.isInfoEnabled())
         {
-            log.info("Aggregating " + page.getPath() + ". Parallel: "
-                    + parallelJobCount + ", Sequential: " + sequentialJobCount);
+            // log.info("Aggregating " + page.getPath() + ". Parallel: "
+            // + parallelJobCount + ", Sequential: " + sequentialJobCount);
+            Object[] args = new Object[]
+            {page.getPath(), Integer.toString(parallelJobCount),
+                    Integer.toString(sequentialJobCount)};
+            log.log("0900037", args); // REPLACED
         }
 
         CurrentWorkerContext.setParallelRenderingMode(parallelJobCount > 0);
@@ -253,8 +259,11 @@
                 .getEffectiveDefaultDecorator(ContentFragment.PORTLET);
         if (log.isDebugEnabled())
         {
-            log.debug("Rendering portlet fragment: [[name, " + f.getName()
-                    + "], [id, " + f.getId() + "]]");
+            // log.debug("Rendering portlet fragment: [[name, " + f.getName()
+            // + "], [id, " + f.getId() + "]]");
+            Object[] args = new Object[]
+            {f.getName(), f.getId()};
+            log.log("0900038", args); // REPLACED
         }
 
         renderer.renderNow(f, context);

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -28,8 +28,9 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.aggregator.RenderingJob;
 import org.apache.jetspeed.aggregator.Worker;
@@ -145,7 +146,8 @@
         }
         catch (Throwable t)
         {
-            log.error("Worker exception", t);
+            // log.error("Worker exception", t);
+            log.log("0900039", t); // REPLACED
         }
     }
 
@@ -183,10 +185,11 @@
             }
             catch (Exception e)
             {
-                log
-                        .error(
-                                "Exception during synchronizing all portlet rendering jobs.",
-                                e);
+                // log
+                // .error(
+                // "Exception during synchronizing all portlet rendering jobs.",
+                // e);
+                log.log("0900040", e); // REPLACED
             }
         }
         else
@@ -214,10 +217,11 @@
             }
             catch (Exception e)
             {
-                log
-                        .error(
-                                "Exception during synchronizing all portlet rendering jobs.",
-                                e);
+                // log
+                // .error(
+                // "Exception during synchronizing all portlet rendering jobs.",
+                // e);
+                log.log("0900041", e); // REPLACED
             }
         }
     }
@@ -242,15 +246,27 @@
     public void workAccepted(WorkEvent we)
     {
         WorkItem workItem = we.getWorkItem();
+        // if (log.isDebugEnabled())
+        // log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem);
         if (log.isDebugEnabled())
-            log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem);
+        {
+            Object[] args = new Object[]
+            {workItem};
+            log.log("0900042", args); // REPLACED
+        }
     }
 
     public void workRejected(WorkEvent we)
     {
         WorkItem workItem = we.getWorkItem();
+        // if (log.isDebugEnabled())
+        // log.debug("[CommonjWorkMonitorImpl] workRejected: " + workItem);
         if (log.isDebugEnabled())
-            log.debug("[CommonjWorkMonitorImpl] workRejected: " + workItem);
+        {
+            Object[] args = new Object[]
+            {workItem};
+            log.log("0900043", args); // REPLACED
+        }
 
         if (this.jobWorksMonitorEnabled)
         {
@@ -261,15 +277,27 @@
     public void workStarted(WorkEvent we)
     {
         WorkItem workItem = we.getWorkItem();
+        // if (log.isDebugEnabled())
+        // log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem);
         if (log.isDebugEnabled())
-            log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem);
+        {
+            Object[] args = new Object[]
+            {workItem};
+            log.log("0900044", args); // REPLACED
+        }
     }
 
     public void workCompleted(WorkEvent we)
     {
         WorkItem workItem = we.getWorkItem();
+        // if (log.isDebugEnabled())
+        // log.debug("[CommonjWorkMonitorImpl] workCompleted: " + workItem);
         if (log.isDebugEnabled())
-            log.debug("[CommonjWorkMonitorImpl] workCompleted: " + workItem);
+        {
+            Object[] args = new Object[]
+            {workItem};
+            log.log("0900045", args); // REPLACED
+        }
 
         if (this.jobWorksMonitorEnabled)
         {
@@ -411,7 +439,8 @@
             }
             catch (Exception e)
             {
-                log.error("Exceptiong during job timeout monitoring.", e);
+                // log.error("Exceptiong during job timeout monitoring.", e);
+                log.log("0900046", e); // REPLACED
             }
         }
 
@@ -489,7 +518,8 @@
                 }
                 catch (Exception e)
                 {
-                    log.error("Exception during job monitoring.", e);
+                    // log.error("Exception during job monitoring.", e);
+                    log.log("0900047", e); // REPLACED
                 }
 
                 try
@@ -512,13 +542,21 @@
 
             try
             {
-                if (log.isWarnEnabled())
+                // if (log.isWarnEnabled())
+                // {
+                // PortletWindow window = job.getWindow();
+                // ObjectID windowId = (null != window ? window.getId() : null);
+                // log
+                // .warn("Portlet Rendering job to be interrupted by timeout ("
+                // + job.getTimeout() + "ms): " + windowId);
+                // }
+                if (log.isInfoEnabled())
                 {
                     PortletWindow window = job.getWindow();
                     ObjectID windowId = (null != window ? window.getId() : null);
-                    log
-                            .warn("Portlet Rendering job to be interrupted by timeout ("
-                                    + job.getTimeout() + "ms): " + windowId);
+                    Object[] args = new Object[]
+                    {Long.toString(job.getTimeout()), windowId};
+                    log.log("0900048", args); // REPLACED
                 }
 
                 PortletContent content = job.getPortletContent();
@@ -539,7 +577,8 @@
             }
             catch (Exception e)
             {
-                log.error("Exceptiong during job killing.", e);
+                // log.error("Exceptiong during job killing.", e);
+                log.log("0900049", e); // REPLACED
             }
             finally
             {

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedEngine.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -22,9 +22,10 @@
 
 import javax.servlet.ServletConfig;
 
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedPortalContext;
 import org.apache.jetspeed.PortalContext;
 import org.apache.jetspeed.PortalReservedParameters;
@@ -122,9 +123,14 @@
         Date startTime = new Date();
         try
         {
-            log.info("Starting Jetspeed Engine (" + getClass().getName()
-                    + ") at " + format.format(startTime));
-
+            // log.info("Starting Jetspeed Engine (" + getClass().getName()
+            // + ") at " + format.format(startTime));
+            if (log.isInfoEnabled())
+            {
+                Object[] args = new Object[]
+                {getClass().getName(), format.format(startTime)};
+                log.log("0900001", args); // REPLACED
+            }
             // patch up OJB
             ClassLoader ploader2 = this.getClass().getClassLoader();
             // ClassLoader ploader2 =
@@ -158,17 +164,28 @@
         }
         catch (Throwable e)
         {
-            e.printStackTrace();
-            log.error(e.toString());
+            // e.printStackTrace();
+            // log.error(e.toString());
+            log.log("0900002", e); // REPLACED
             throw new JetspeedException("Jetspeed Initialization exception!", e);
         }
         finally
         {
-            Date endTime = new Date();
-            long elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000;
-            log.info("Finished starting Jetspeed Engine ("
-                    + getClass().getName() + ") at " + format.format(endTime)
-                    + ".  Elapsed time: " + elapsedTime + " seconds.");
+            // Date endTime = new Date();
+            // long elapsedTime = (endTime.getTime() - startTime.getTime()) /
+            // 1000;
+            // log.info("Finished starting Jetspeed Engine ("
+            // + getClass().getName() + ") at " + format.format(endTime)
+            // + ". Elapsed time: " + elapsedTime + " seconds.");
+            if (log.isInfoEnabled())
+            {
+                Date endTime = new Date();
+                long elapsedTime = (endTime.getTime() - startTime.getTime()) / 1000;
+                Object[] args = new Object[]
+                {getClass().getName(), format.format(endTime),
+                        Long.toString(elapsedTime)};
+                log.log("0900003", args); // REPLACED
+            }
         }
     }
 
@@ -349,7 +366,10 @@
         }
         catch (NoSuchBeanDefinitionException e)
         {
-            log.warn("No ContainerService defined for " + service.getName());
+            // log.warn("No ContainerService defined for " + service.getName());
+            Object[] args = new Object[]
+            {service.getName()};
+            log.log("0900004", args, e); // REPLACED
             return null;
         }
     }

Modified: pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
===================================================================
--- pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java	2008-06-19 22:24:31 UTC (rev 992)
+++ pal-portal/branches/pal-portal-1.x/portal/jetspeed-2/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java	2008-06-19 22:26:05 UTC (rev 993)
@@ -29,11 +29,11 @@
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
+import jp.sf.pal.portal.logging.Log;
+import jp.sf.pal.portal.logging.LogFactory;
+
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.cache.ContentCacheKeyGenerator;
@@ -96,7 +96,8 @@
     // -------------------------------------------------------------------
     // I N I T I A L I Z A T I O N
     // -------------------------------------------------------------------
-    private static final String INIT_START_MSG = "Jetspeed Starting Initialization...";
+    // private static final String INIT_START_MSG = "Jetspeed Starting
+    // Initialization...";
 
     private static final String INIT_DONE_MSG = "Jetspeed Initialization complete, Ready to service requests.";
 
@@ -113,15 +114,26 @@
                 console = LogFactory.getLog(CONSOLE_LOGGER);
             }
 
-            console.info(INIT_START_MSG);
-
+            // console.info(INIT_START_MSG);
+            if (console.isInfoEnabled())
+            {
+                console.log("0900011"); // REPLACED
+            }
             super.init(config);
 
             if (!firstInit)
             {
-                log.info("Double initialization of Jetspeed was attempted!");
-                console
-                        .info("Double initialization of Jetspeed was attempted!");
+                // log.info("Double initialization of Jetspeed was attempted!");
+                if (log.isInfoEnabled())
+                {
+                    log.log("0900005");// REPLACED
+                }
+                // console
+                // .info("Double initialization of Jetspeed was attempted!");
+                if (console.isInfoEnabled())
+                {
+                    console.log("0900012"); // REPLACED
+                }
                 return;
             }
             // executing init will trigger some static initializers, so we have
@@ -141,13 +153,22 @@
                         context, config, APPLICATION_ROOT_KEY,
                         APPLICATION_ROOT_DEFAULT);
 
-                console
-                        .info("JetspeedServlet identifying web application root...");
+                // console
+                // .info("JetspeedServlet identifying web application root...");
+                if (console.isInfoEnabled())
+                {
+                    console.log("0900013");
+                }
                 webappRoot = config.getServletContext().getRealPath("/");
-                console
-                        .info("JetspeedServlet identifed web application root as "
-                                + webappRoot);
-
+                // console
+                // .info("JetspeedServlet identifed web application root as "
+                // + webappRoot);
+                if (console.isInfoEnabled())
+                {
+                    Object[] args = new Object[]
+                    {webappRoot};
+                    console.log("0900014", args); // REPLACED
+                }
                 if (applicationRoot == null
                         || applicationRoot.equals(WEB_CONTEXT))
                 {
@@ -160,19 +181,33 @@
                 properties.setProperty(APPLICATION_ROOT_KEY, applicationRoot);
                 properties.setProperty(WEBAPP_ROOT_KEY, webappRoot);
 
-                console
-                        .info("JetspeedServlet attempting to create the  portlet engine...");
-
+                // console
+                // .info("JetspeedServlet attempting to create the portlet
+                // engine...");
+                if (console.isInfoEnabled())
+                {
+                    console.log("0900015"); // REPLACED
+                }
                 engine = new JetspeedEngine(properties, applicationRoot,
                         config, initializeComponentManager(config,
                                 applicationRoot, properties));
 
-                console
-                        .info("JetspeedServlet attempting to start the Jetspeed Portal Engine...");
+                // console
+                // .info("JetspeedServlet attempting to start the Jetspeed
+                // Portal Engine...");
+                if (console.isInfoEnabled())
+                {
+                    console.log("0900016"); // REPLACED
+                }
                 Jetspeed.setEngine(engine);
                 engine.start();
-                console
-                        .info("JetspeedServlet has successfuly started the Jetspeed Portal Engine....");
+                // console
+                // .info("JetspeedServlet has successfuly started the Jetspeed
+                // Portal Engine....");
+                if (console.isInfoEnabled())
+                {
+                    console.log("0900017"); // REPLACED
+                }
                 contextComponent = (RequestContextComponent) Jetspeed
                         .getComponentManager().getComponent(
                                 RequestContextComponent.class);
@@ -182,12 +217,22 @@
                 // save the exception to complain loudly later :-)
                 final String msg = "Jetspeed: init() failed: ";
                 initFailure = e;
-                log.fatal(msg, e);
-                console.fatal(msg, e);
+                // log.fatal(msg, e);
+                log.log("0900006", e); // REPLACED
+                // console.fatal(msg, e);
+                console.log("0900018", e); // REPLACED
             }
 
-            console.info(INIT_DONE_MSG);
-            log.info(INIT_DONE_MSG);
+            // console.info(INIT_DONE_MSG);
+            if (console.isInfoEnabled())
+            {
+                console.log("0900019");// REPLACED
+            }
+            // log.info(INIT_DONE_MSG);
+            if (log.isInfoEnabled())
+            {
+                log.log("0900007"); // REPLACED
+            }
         }
     }
 
@@ -270,10 +315,13 @@
         }
         catch (JetspeedException e)
         {
-            final String msg = "Fatal error encountered while processing portal request: "
-                    + e.toString();
-            log.fatal(msg, e);
-            throw new ServletException(msg, e);
+            // final String msg = "Fatal error encountered while processing
+            // portal request: "
+            // + e.toString();
+            // log.fatal(msg, e);
+            // throw new ServletException(msg, e);
+            log.fatal("0900008", e); // REPLACED
+            throw new ServletException(log.getString("0900008"), e);
         }
     }
 
@@ -311,14 +359,20 @@
         }
         catch (JetspeedException e)
         {
-            log.fatal("Jetspeed: shutdown() failed: ", e);
-            System.err.println(ExceptionUtils.getStackTrace(e));
+            // log.fatal("Jetspeed: shutdown() failed: ", e);
+            log.log("0900009", e);
+            // TODO needed?
+            // System.err.println(ExceptionUtils.getStackTrace(e));
         }
 
         // Allow turbine to be started back up again.
         firstInit = true;
 
-        log.info("Done shutting down!");
+        // log.info("Done shutting down!");
+        if (log.isInfoEnabled())
+        {
+            log.log("0900010");
+        }
     }
 
     /**


pal-cvs メーリングリストの案内