You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "David H. DeWolf" <da...@daviddewolf.com> on 2004/02/16 05:24:15 UTC

[Patch] Logging Enhancements

I have implemented the logging enhancements we agreed to in the thread 
below:

http://nagoya.apache.org/eyebrowse/BrowseList?listName=pluto-dev@jakarta.apache.org&by=thread&from=634810

Everything needed to apply the patch is enclosed - including:
1. Diff of all that has changed
2. New class files

Here is a recap of what has changed:

Container Changes:
------------------------------------
LogService interface has changed in the following ways in order for the 
LogService to act as a factory for logging implementations :
1) All isXXXEnabled() methods have been removed
2) All logging methods have been removed
3) getLogger(String) and getLogger(Class) have been added.

Logger interface has been added.  It includes:
1) All isXXXEnabled() methods
2) All logging methods removed from LogService

Finally, All pluto classes which log now lookup a Logger using the 
LogService implementation provided by the container's environment.  
Because of this, the static Log class can and should be removed.

Portal Driver changes:
---------------------------------
The LogServiceImpl has been modified to implement the new version of 
pluto's LogService interface.   It returns Loggers of type LoggerImpl

LoggerImpl has been created.  It utilizes commons logging for all 
logging functions.

Where possible (and where it makes sense), all driver classes that 
utilize significant logging grab their own instance of Logger and use it 
for logging.  Each instance access the LogService directly from the 
driver's ServiceManager (instead of looking it up through the containers 
abstractions -- which would eventually bring it back to the 
ServiceManager anyways.

The driver's Log class has been modified so that all static invocations 
utilize a single Logger (org.apache.pluto.portalImpl) and it is not 
looked up each time.  Because of this, the 'aComponent' argument is no 
longer available to within static logging methods.

All classes have been modified to utilize the above portal changes.

Other:
--------------------------------
As a result of these changes, the commons logging system is used by 
default whenever pluto is deployed.  If commons logging configuration is 
not found, commons logging will initialize itself using the "SimpleLog" 
. Basically, by default,  the SimpleLog writes all log messages that are 
info and above to Standard error. Please see commons logging 
documentation for more details.

A StandardOutLogService and StandardOutLogger have been implemented for 
use with the Deployer.  This is especially useful since the Deployer 
does not worry about registering services with the driver's ServiceManager.

David

Re: [Patch] Logging Enhancements

Posted by "David H. DeWolf" <da...@vivare.com>.
Michael Blum wrote:

> David,
>
> I applied your patches and imported the new java files. Everything 
> works well. Good job. I am going to commit your changes for you.
>
> By the way I have not found any comment from you about the following 
> classes:
>  jakarta-pluto/container/src/java/org/apache/pluto/services/log/Log.java
>  
> jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceCommonsLoggingImpl.java 
>
> I think these two classes are now obsolete, right? Is it correct to 
> delete them?


Yes, both of them can be removed! Thanks for taking the time to commit 
the changes.

David

>
> Michael
>
> David H. DeWolf wrote:
>
>> I have implemented the logging enhancements we agreed to in the 
>> thread below:
>>
>> http://nagoya.apache.org/eyebrowse/BrowseList?listName=pluto-dev@jakarta.apache.org&by=thread&from=634810 
>>
>>
>> Everything needed to apply the patch is enclosed - including:
>> 1. Diff of all that has changed
>> 2. New class files
>>
>> Here is a recap of what has changed:
>>
>> Container Changes:
>> ------------------------------------
>> LogService interface has changed in the following ways in order for 
>> the LogService to act as a factory for logging implementations :
>> 1) All isXXXEnabled() methods have been removed
>> 2) All logging methods have been removed
>> 3) getLogger(String) and getLogger(Class) have been added.
>>
>> Logger interface has been added.  It includes:
>> 1) All isXXXEnabled() methods
>> 2) All logging methods removed from LogService
>>
>> Finally, All pluto classes which log now lookup a Logger using the 
>> LogService implementation provided by the container's environment.  
>> Because of this, the static Log class can and should be removed.
>>
>> Portal Driver changes:
>> ---------------------------------
>> The LogServiceImpl has been modified to implement the new version of 
>> pluto's LogService interface.   It returns Loggers of type LoggerImpl
>>
>> LoggerImpl has been created.  It utilizes commons logging for all 
>> logging functions.
>>
>> Where possible (and where it makes sense), all driver classes that 
>> utilize significant logging grab their own instance of Logger and use 
>> it for logging.  Each instance access the LogService directly from 
>> the driver's ServiceManager (instead of looking it up through the 
>> containers abstractions -- which would eventually bring it back to 
>> the ServiceManager anyways.
>>
>> The driver's Log class has been modified so that all static 
>> invocations utilize a single Logger (org.apache.pluto.portalImpl) and 
>> it is not looked up each time.  Because of this, the 'aComponent' 
>> argument is no longer available to within static logging methods.
>>
>> All classes have been modified to utilize the above portal changes.
>>
>> Other:
>> --------------------------------
>> As a result of these changes, the commons logging system is used by 
>> default whenever pluto is deployed.  If commons logging configuration 
>> is not found, commons logging will initialize itself using the 
>> "SimpleLog" . Basically, by default,  the SimpleLog writes all log 
>> messages that are info and above to Standard error. Please see 
>> commons logging documentation for more details.
>>
>> A StandardOutLogService and StandardOutLogger have been implemented 
>> for use with the Deployer.  This is especially useful since the 
>> Deployer does not worry about registering services with the driver's 
>> ServiceManager.
>>
>> David
>>
>> ------------------------------------------------------------------------
>>
>> /*
>> * The Apache Software License, Version 1.1
>> *
>> * Copyright (c) 2003 The Apache Software Foundation.  All rights * 
>> reserved.
>> *
>> * Redistribution and use in source and binary forms, with or without
>> * modification, are permitted provided that the following conditions
>> * are met:
>> *
>> * 1. Redistributions of source code must retain the above copyright
>> *    notice, this list of conditions and the following disclaimer. *
>> * 2. Redistributions in binary form must reproduce the above copyright
>> *    notice, this list of conditions and the following disclaimer in
>> *    the documentation and/or other materials provided with the
>> *    distribution.
>> *
>> * 3. The end-user documentation included with the redistribution, if
>> *    any, must include the following acknowlegement:  *       "This 
>> product includes software developed by the *        Apache Software 
>> Foundation (http://www.apache.org/)."
>> *    Alternately, this acknowlegement may appear in the software itself,
>> *    if and wherever such third-party acknowlegements normally appear.
>> *
>> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
>> *    Foundation" must not be used to endorse or promote products derived
>> *    from this software without prior written permission. For written 
>> *    permission, please contact apache@apache.org.
>> *
>> * 5. Products derived from this software may not be called "Apache"
>> *    nor may "Apache" appear in their names without prior written
>> *    permission of the Apache Group.
>> *
>> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> * SUCH DAMAGE.
>> * ====================================================================
>> *
>> * This software consists of voluntary contributions made by many
>> * individuals on behalf of the Apache Software Foundation.  For more
>> * information on the Apache Software Foundation, please see
>> * <http://www.apache.org/>.
>> */
>> /*
>> */
>>
>> package org.apache.pluto.services.log;
>>
>> import org.apache.pluto.services.ContainerService;
>>
>> /** Implemented in order to provide component aware
>> *  logging.
>> *
>> * @see LogService
>> *
>> */
>> public interface Logger extends ContainerService
>> {
>>
>>    public boolean isDebugEnabled();
>>    public boolean isInfoEnabled();
>>    public boolean isWarnEnabled();
>>    public boolean isErrorEnabled();
>>
>>    public void debug(String aMessage);
>>    public void debug(String aMessage, Throwable aThrowable);
>>    public void info(String aMessage);
>>    public void warn(String aMessage);
>>    public void error(String aMessage);
>>    public void error(String aMessage, Throwable aThrowable);
>>    public void error(Throwable aThrowable);
>>
>> }
>>  
>>
>> ------------------------------------------------------------------------
>>
>> /*
>> * The Apache Software License, Version 1.1
>> *
>> * Copyright (c) 2003 The Apache Software Foundation.  All rights * 
>> reserved.
>> *
>> * Redistribution and use in source and binary forms, with or without
>> * modification, are permitted provided that the following conditions
>> * are met:
>> *
>> * 1. Redistributions of source code must retain the above copyright
>> *    notice, this list of conditions and the following disclaimer. *
>> * 2. Redistributions in binary form must reproduce the above copyright
>> *    notice, this list of conditions and the following disclaimer in
>> *    the documentation and/or other materials provided with the
>> *    distribution.
>> *
>> * 3. The end-user documentation included with the redistribution, if
>> *    any, must include the following acknowlegement:  *       "This 
>> product includes software developed by the *        Apache Software 
>> Foundation (http://www.apache.org/)."
>> *    Alternately, this acknowlegement may appear in the software itself,
>> *    if and wherever such third-party acknowlegements normally appear.
>> *
>> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
>> *    Foundation" must not be used to endorse or promote products derived
>> *    from this software without prior written permission. For written 
>> *    permission, please contact apache@apache.org.
>> *
>> * 5. Products derived from this software may not be called "Apache"
>> *    nor may "Apache" appear in their names without prior written
>> *    permission of the Apache Group.
>> *
>> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> * SUCH DAMAGE.
>> * ====================================================================
>> *
>> * This software consists of voluntary contributions made by many
>> * individuals on behalf of the Apache Software Foundation.  For more
>> * information on the Apache Software Foundation, please see
>> * <http://www.apache.org/>.
>> */
>> /*
>> */
>>
>> package org.apache.pluto.portalImpl.services.log;
>>
>> import org.apache.pluto.services.log.Logger;
>>
>> /** Defines a LogService that may be used when
>> *  one has not been registered with the ServiceManager.
>> *  This is specifically usefull in cases, such as
>> *  when the Deployer is run, in which no Service are
>> *  registered.
>> *
>> *  The StandardOutLogService is implemented as a
>> *  Singleton since all log messages will be going
>> *  to StandardOut no matter what! Since all behaivior
>> *  will be identical, there's no reason to create
>> *  multiple instances.
>> */
>> public class StandardOutLogService extends LogService {
>>
>>    private static Logger logger = null;
>>
>>    private static LogService service;
>>
>>    public static LogService getInstance() {
>>        if(service==null)
>>            service = new StandardOutLogService();
>>        return service;
>>    }
>>
>>    private StandardOutLogService() {
>>        logger = new StandardOutLogger();
>>    }
>>
>>    public Logger getLogger(String aComponent) {
>>        return logger;
>>    }
>>       public Logger getLogger(Class klass) {
>>        return logger;
>>    }
>>
>> }
>>  
>>
>> ------------------------------------------------------------------------
>>
>> /*
>> * The Apache Software License, Version 1.1
>> *
>> * Copyright (c) 2003 The Apache Software Foundation.  All rights * 
>> reserved.
>> *
>> * Redistribution and use in source and binary forms, with or without
>> * modification, are permitted provided that the following conditions
>> * are met:
>> *
>> * 1. Redistributions of source code must retain the above copyright
>> *    notice, this list of conditions and the following disclaimer. *
>> * 2. Redistributions in binary form must reproduce the above copyright
>> *    notice, this list of conditions and the following disclaimer in
>> *    the documentation and/or other materials provided with the
>> *    distribution.
>> *
>> * 3. The end-user documentation included with the redistribution, if
>> *    any, must include the following acknowlegement:  *       "This 
>> product includes software developed by the *        Apache Software 
>> Foundation (http://www.apache.org/)."
>> *    Alternately, this acknowlegement may appear in the software itself,
>> *    if and wherever such third-party acknowlegements normally appear.
>> *
>> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
>> *    Foundation" must not be used to endorse or promote products derived
>> *    from this software without prior written permission. For written 
>> *    permission, please contact apache@apache.org.
>> *
>> * 5. Products derived from this software may not be called "Apache"
>> *    nor may "Apache" appear in their names without prior written
>> *    permission of the Apache Group.
>> *
>> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> * SUCH DAMAGE.
>> * ====================================================================
>> *
>> * This software consists of voluntary contributions made by many
>> * individuals on behalf of the Apache Software Foundation.  For more
>> * information on the Apache Software Foundation, please see
>> * <http://www.apache.org/>.
>> */
>> /*
>> */
>>
>> package org.apache.pluto.portalImpl.services.log;
>>
>> import org.apache.commons.logging.Log;
>> import org.apache.pluto.services.log.Logger;
>>
>> public class LoggerImpl implements Logger {
>>
>>    private Log log = null;
>>
>>    public LoggerImpl(Log log) {
>>        this.log = log;
>>    }
>>
>>    public boolean isDebugEnabled() {
>>        return log.isDebugEnabled();
>>    }
>>
>>    public boolean isInfoEnabled() {
>>        return log.isInfoEnabled();
>>    }
>>
>>    public boolean isWarnEnabled() {
>>        return log.isWarnEnabled();
>>    }
>>
>>    public boolean isErrorEnabled() {
>>        return log.isErrorEnabled();
>>    }
>>
>>    public void debug(String aMessage) {
>>        log.debug(aMessage);
>>    }
>>
>>    public void debug(String aMessage, Throwable aThrowable) {
>>        log.debug(aMessage, aThrowable);
>>    }
>>
>>    public void info(String aMessage) {
>>        log.info(aMessage);
>>    }
>>
>>    public void warn(String aMessage) {
>>        log.warn(aMessage);
>>    }
>>
>>    public void error(String aMessage) {
>>        log.error(aMessage);
>>    }
>>
>>    public void error(String aMessage, Throwable aThrowable) {
>>        log.error(aMessage);
>>    }
>>
>>    public void error(Throwable aThrowable) {
>>        log.error("Exception caught: ", aThrowable);
>>    }
>>
>> }
>>  
>>
>> ------------------------------------------------------------------------
>>
>> /*
>> * The Apache Software License, Version 1.1
>> *
>> * Copyright (c) 2003 The Apache Software Foundation.  All rights * 
>> reserved.
>> *
>> * Redistribution and use in source and binary forms, with or without
>> * modification, are permitted provided that the following conditions
>> * are met:
>> *
>> * 1. Redistributions of source code must retain the above copyright
>> *    notice, this list of conditions and the following disclaimer. *
>> * 2. Redistributions in binary form must reproduce the above copyright
>> *    notice, this list of conditions and the following disclaimer in
>> *    the documentation and/or other materials provided with the
>> *    distribution.
>> *
>> * 3. The end-user documentation included with the redistribution, if
>> *    any, must include the following acknowlegement:  *       "This 
>> product includes software developed by the *        Apache Software 
>> Foundation (http://www.apache.org/)."
>> *    Alternately, this acknowlegement may appear in the software itself,
>> *    if and wherever such third-party acknowlegements normally appear.
>> *
>> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
>> *    Foundation" must not be used to endorse or promote products derived
>> *    from this software without prior written permission. For written 
>> *    permission, please contact apache@apache.org.
>> *
>> * 5. Products derived from this software may not be called "Apache"
>> *    nor may "Apache" appear in their names without prior written
>> *    permission of the Apache Group.
>> *
>> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
>> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
>> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
>> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> * SUCH DAMAGE.
>> * ====================================================================
>> *
>> * This software consists of voluntary contributions made by many
>> * individuals on behalf of the Apache Software Foundation.  For more
>> * information on the Apache Software Foundation, please see
>> * <http://www.apache.org/>.
>> */
>> /*
>> */
>>
>> package org.apache.pluto.portalImpl.services.log;
>>
>> import org.apache.pluto.services.log.Logger;
>>
>> /** An incredible simple Logger implementation which
>> *  simply directs messages to StandardOut.  This Logger
>> *  is only used in cases, such as in the Deployer, when
>> *  no services are registered with the ServiceManager.
>> */
>> public class StandardOutLogger implements Logger {
>>
>>    public StandardOutLogger() {
>>    }
>>
>>    public boolean isDebugEnabled() {
>>        return true;
>>    }
>>
>>    public boolean isInfoEnabled() {
>>        return true;
>>    }
>>
>>    public boolean isWarnEnabled() {
>>        return true;
>>    }
>>
>>    public boolean isErrorEnabled() {
>>        return true;
>>    }
>>
>>    public void debug(String aMessage) {
>>        System.out.println(aMessage);
>>    }
>>
>>    public void debug(String aMessage, Throwable aThrowable) {
>>        System.out.println(aMessage);
>>        aThrowable.printStackTrace();
>>    }
>>
>>    public void info(String aMessage) {
>>        System.out.println(aMessage);
>>    }
>>
>>    public void warn(String aMessage) {
>>        System.out.println(aMessage);
>>    }
>>
>>    public void error(String aMessage) {
>>        System.out.println(aMessage);
>>    }
>>
>>    public void error(String aMessage, Throwable aThrowable) {
>>        System.out.println(aMessage);
>>        aThrowable.printStackTrace();
>>    }
>>
>>    public void error(Throwable aThrowable) {
>>        aThrowable.printStackTrace();
>>    }
>>
>> }
>>  
>>
>> ------------------------------------------------------------------------
>>
>> ? logging-patch-diff.txt
>> ? container/src/java/org/apache/pluto/services/log/Logger.java
>> ? 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LoggerImpl.java
>> ? 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogService.java 
>>
>> ? 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogger.java 
>>
>> Index: container/src/java/org/apache/pluto/PortletContainerImpl.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/PortletContainerImpl.java,v 
>>
>> retrieving revision 1.2
>> diff -u -r1.2 PortletContainerImpl.java
>> --- container/src/java/org/apache/pluto/PortletContainerImpl.java    
>> 8 Jan 2004 02:20:16 -0000    1.2
>> +++ container/src/java/org/apache/pluto/PortletContainerImpl.java    
>> 16 Feb 2004 04:14:12 -0000
>> @@ -75,7 +75,8 @@
>> import org.apache.pluto.services.information.DynamicInformationProvider;
>> import org.apache.pluto.services.information.InformationProviderAccess;
>> import org.apache.pluto.services.information.PortletURLProvider;
>> -import org.apache.pluto.services.log.Log;
>> +import org.apache.pluto.services.log.Logger;
>> +import org.apache.pluto.services.log.LogService;
>>
>> /**
>>  *  Implements the Pluto Container.
>> @@ -90,6 +91,8 @@
>>     private Properties properties;
>>     private boolean initialized;
>>
>> +    private Logger log = null;
>> +
>>     public void init(String uniqueContainerName,
>>                      ServletConfig servletConfig,
>>                      PortletContainerEnvironment environment,
>> @@ -101,6 +104,12 @@
>>         PortletContainerServices.createReference(uniqueContainerName, 
>> environment);
>>         this.properties = properties;
>>         initialized = true;
>> +
>> +        // Initialize the Logger that we will use
>> +        // from here forward for this Container:
>> +        log = ((LogService)environment
>> +                .getContainerService(LogService.class))
>> +                .getLogger(getClass());
>>     }
>>
>>     public void shutdown() throws PortletContainerException
>> @@ -117,10 +126,9 @@
>>         PortletContainerServices.prepare(uniqueContainerName);
>>         PortletInvoker invoker = null;
>>         -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>> +        if (log.isDebugEnabled())
>>         {
>> -            Log.debug("org.apache.pluto.invoker",
>> -                      "PortletContainerImpl.portletService(" + 
>> portletWindow.getId() + ") called.");
>> +            log.debug("PortletContainerImpl.portletService(" + 
>> portletWindow.getId() + ") called.");
>>         }
>>
>>         try
>> @@ -153,10 +161,9 @@
>>         PortletContainerServices.prepare(uniqueContainerName);
>>         PortletInvoker invoker = null;
>>
>> -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>> +        if (log.isDebugEnabled())
>>         {
>> -            Log.debug("org.apache.pluto.invoker",
>> -                      "PortletContainerImpl.performPortletAction(" + 
>> portletWindow.getId() + ") called.");
>> +            log.debug("PortletContainerImpl.performPortletAction(" + 
>> portletWindow.getId() + ") called.");
>>         }
>>
>>         String location = null;
>> @@ -270,9 +277,8 @@
>>         PortletContainerServices.prepare(uniqueContainerName);
>>         PortletInvoker invoker = null;
>>
>> -        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>> -            Log.debug("org.apache.pluto.invoker",
>> -                      
>> "PortletContainerImpl.portletLoad("+portletWindow.getId()+") called.");
>> +        if (log.isDebugEnabled())
>> +            
>> log.debug("PortletContainerImpl.portletLoad("+portletWindow.getId()+") 
>> called.");
>>
>>         RenderRequest renderRequest = 
>> PortletObjectAccess.getRenderRequest(portletWindow, 
>>                                                                            
>> servletRequest, Index: 
>> container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 PortletInvokerImpl.java
>> --- 
>> container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java    
>> 7 Jan 2004 20:37:23 -0000    1.1
>> +++ 
>> container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java    
>> 16 Feb 2004 04:14:13 -0000
>> @@ -73,17 +73,27 @@
>> import org.apache.pluto.core.CoreUtils;
>> import org.apache.pluto.core.InternalPortletRequest;
>> import org.apache.pluto.core.InternalPortletResponse;
>> -import org.apache.pluto.services.log.Log;
>> +import org.apache.pluto.services.log.Logger;
>> +import org.apache.pluto.services.log.LogService;
>> import org.apache.pluto.invoker.PortletInvoker;
>> import org.apache.pluto.om.portlet.PortletDefinition;
>> import org.apache.pluto.om.servlet.ServletDefinition;
>> +import org.apache.pluto.PortletContainerServices;
>>
>> public class PortletInvokerImpl implements PortletInvoker
>> {
>>     private javax.servlet.ServletConfig servletConfig;
>>     private PortletDefinition portletDefinition;
>>
>> -    public PortletInvokerImpl(PortletDefinition portletDefinition, 
>> +    /* This Logger can be saved due to the
>> +     * fact that a unique instance of PortletInvoker
>> +     * will be used for each request. We load it
>> +     * lazily since we only log exceptions at
>> +     * this point.
>> +     */
>> +    private Logger log = null;
>> +
>> +    public PortletInvokerImpl(PortletDefinition portletDefinition,
>>                               javax.servlet.ServletConfig servletConfig)
>>     {
>>         this.portletDefinition = portletDefinition;
>> @@ -93,7 +103,7 @@
>>     // org.apache.pluto.invoker.PortletInvoker implementation 
>> -------------------------------------
>>     public void action(ActionRequest request, ActionResponse 
>> response) throws PortletException,IOException
>>     {
>> -        
>> invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);  
>> +        
>> invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);
>>     }
>>
>>     public void render(RenderRequest request, RenderResponse 
>> response) throws PortletException, IOException
>> @@ -109,8 +119,7 @@
>>         }
>>         catch (IOException e)
>>         {
>> -            Log.error("org.apache.pluto.invoker",
>> -                      "PortletInvokerImpl.load() - Error while 
>> dispatching portlet.",e);
>> +            getLog().error("PortletInvokerImpl.load() - Error while 
>> dispatching portlet.",e);
>>             throw new PortletException(e);
>>         }
>>     }
>> @@ -150,8 +159,7 @@
>>             }
>>             catch (javax.servlet.UnavailableException e)
>>             {
>> -                Log.error("org.apache.pluto.invoker",
>> -                          "PortletInvokerImpl.invoke() - Error while 
>> dispatching portlet.",e);
>> +                getLog().error("PortletInvokerImpl.invoke() - Error 
>> while dispatching portlet.",e);
>>                 if (e.isPermanent())
>>                 {
>>                     throw new 
>> javax.portlet.UnavailableException(e.getMessage());
>> @@ -165,8 +173,7 @@
>>             {
>>                 if (e.getRootCause() != null)
>>                 {
>> -                    Log.error("org.apache.pluto.invoker",
>> -                              "PortletInvokerImpl.render() - Error 
>> while dispatching portlet.",
>> +                    getLog().error("PortletInvokerImpl.render() - 
>> Error while dispatching portlet.",
>>                               e.getRootCause());
>>                     if (e.getRootCause() instanceof PortletException)
>>                     {
>> @@ -179,8 +186,7 @@
>>                 }
>>                 else
>>                 {
>> -                    Log.error("org.apache.pluto.invoker",
>> -                              "PortletInvokerImpl.invoke() - Error 
>> while dispatching portlet.",
>> +                    getLog().error("PortletInvokerImpl.invoke() - 
>> Error while dispatching portlet.",
>>                               e);
>>                     throw new PortletException(e);
>>                 }
>> @@ -194,9 +200,24 @@
>>         }
>>         else
>>         {
>> -            Log.error("org.apache.pluto.invoker",
>> -                      "PortletInvokerImpl.action() - Unable to find 
>> RequestDispatcher.");
>> +            getLog().error("PortletInvokerImpl.action() - Unable to 
>> find RequestDispatcher.");
>>         }
>>     }
>>     // 
>> -------------------------------------------------------------------------------------------- 
>>
>> +
>> +    /** Provides lazy instantiation of the Logger.
>> +     *  This is usefull since the log is currently only
>> +     *  used when an error occurs.  B/C of this, there is
>> +     *  no reason to retrieve the log until needed.
>> +     * @return
>> +     */
>> +    private Logger getLog() {
>> +        if(log==null) {
>> +        // from here forward for this Container:
>> +            log = ((LogService)PortletContainerServices
>> +                .get(LogService.class))
>> +                .getLogger(getClass());
>> +        }
>> +        return log;
>> +    }
>> }
>> Index: container/src/java/org/apache/pluto/services/log/LogService.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/services/log/LogService.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 LogService.java
>> --- 
>> container/src/java/org/apache/pluto/services/log/LogService.java    7 
>> Jan 2004 20:37:17 -0000    1.1
>> +++ 
>> container/src/java/org/apache/pluto/services/log/LogService.java    
>> 16 Feb 2004 04:14:13 -0000
>> @@ -59,28 +59,27 @@
>>
>> import org.apache.pluto.services.ContainerService;
>>
>> -/**
>> - * The interfaces defined in this package represent an abstract object
>> - * model (OM) that is applicable for different implementations.
>> - * <P>
>> - * This abstraction layer helps to generalize the portlet container 
>> from
>> - * special implementations like data storage and moreover it is not 
>> bound
>> - * to a special implementation.
>> +/** Implemented in order to provides access to
>> + *  a custom Logger implementation. The Logger
>> + *  provides component aware logging capabilities.
>> + *
>>  */
>> -public interface LogService extends ContainerService
>> -{
>> +public interface LogService extends ContainerService {
>>
>> +    /** Used to retrieve a Logger implementation
>> +     *  which can be used to log information for the given
>> +     *  component.
>> +     * @param component
>> +     * @return
>> +     */
>> +    Logger getLogger(String component);
>>
>> -    public boolean isDebugEnabled (String aComponent);
>> -    public boolean isInfoEnabled (String aComponent);
>> -    public boolean isWarnEnabled (String aComponent);
>> -    public boolean isErrorEnabled (String aComponent);
>> -
>> -    public void debug (String aComponent, String aMessage);
>> -    public void debug (String aComponent, String aMessage, Throwable 
>> aThrowable);
>> -    public void info (String aComponent, String aMessage);
>> -    public void warn (String aComponent, String aMessage);
>> -    public void error (String aComponent, String aMessage, Throwable 
>> aThrowable);
>> -    public void error (String aComponent, Throwable aThrowable);
>> +    /** Used to retrieve a Logger implementation
>> +     *  which can be used to log information for the given
>> +     *  Class.
>> +     * @param klass
>> +     * @return
>> +     */
>> +    Logger getLogger(Class klass);
>>
>> }
>> Index: portal/src/java/org/apache/pluto/portalImpl/Servlet.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Servlet.java,v 
>>
>> retrieving revision 1.2
>> diff -u -r1.2 Servlet.java
>> --- portal/src/java/org/apache/pluto/portalImpl/Servlet.java    20 
>> Jan 2004 09:30:10 -0000    1.2
>> +++ portal/src/java/org/apache/pluto/portalImpl/Servlet.java    16 
>> Feb 2004 04:14:14 -0000
>> @@ -68,6 +68,7 @@
>> import javax.servlet.http.HttpServletResponse;
>>
>> import org.apache.pluto.PortletContainerException;
>> +import org.apache.pluto.services.log.Logger;
>> import org.apache.pluto.om.window.PortletWindow;
>> import org.apache.pluto.portalImpl.aggregation.RootFragment;
>> import org.apache.pluto.portalImpl.core.PortalControlParameter;
>> @@ -76,9 +77,9 @@
>> import org.apache.pluto.portalImpl.core.PortletContainerEnvironment;
>> import org.apache.pluto.portalImpl.core.PortletContainerFactory;
>> import org.apache.pluto.portalImpl.services.ServiceManager;
>> +import org.apache.pluto.portalImpl.services.log.Log;
>> import 
>> org.apache.pluto.portalImpl.services.factorymanager.FactoryManager;
>> import org.apache.pluto.portalImpl.factory.FactoryAccess;
>> -import org.apache.pluto.portalImpl.services.log.Log;
>> import org.apache.pluto.portalImpl.services.config.Config;
>> import org.apache.pluto.portalImpl.services.pageregistry.PageRegistry;
>> import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
>> @@ -87,9 +88,7 @@
>> public class Servlet extends HttpServlet
>> {
>>
>> -    public Servlet ()
>> -    {
>> -    }
>> +    private Logger log = null;
>>
>>     public String getServletInfo()
>>     {
>> @@ -122,14 +121,19 @@
>>             throw (new javax.servlet.UnavailableException ("Post 
>> initialization of one or more services failed."));
>>         }
>>
>> -        IS_DEBUG_ENABLED = Log.isDebugEnabled 
>> ("org.apache.pluto.portalImpl");
>> +        log = Log.getService().getLogger(getClass());
>>
>>         if 
>> (!PortletContainerFactory.getPortletContainer().isInitialized()) {
>> -            log ("Initializing PortletContainer...");
>> -    -            String uniqueContainerName = 
>> Config.getParameters().getString ("portletcontainer.uniquename", 
>> "pluto");
>> +            String uniqueContainerName =
>> +               
>> Config.getParameters().getString("portletcontainer.uniquename", 
>> "pluto");
>> +
>> +            if(log.isInfoEnabled())
>> +                log.info("Initializing PortletContainer ["
>> +                          +uniqueContainerName+"]...");
>>     -            PortletContainerEnvironment environment = new 
>> PortletContainerEnvironment();
>> +            PortletContainerEnvironment environment
>> +                = new PortletContainerEnvironment();
>> +
>>             environment.addContainerService(Log.getService());
>>             
>> environment.addContainerService(FactoryManager.getService());
>>             
>> environment.addContainerService(FactoryAccess.getInformationProviderContainerService()); 
>>
>> @@ -145,19 +149,20 @@
>>             }
>>             catch (PortletContainerException exc)
>>             {
>> -                log ("Initialization of the portlet container 
>> failed!", exc);
>> -    +                log.error("Initialization of the portlet 
>> container failed!", exc);
>>                 throw (new javax.servlet.UnavailableException 
>> ("Initialization of the portlet container failed."));
>>             }
>> -        } else {
>> -            log("PortletContainer already initialized");
>> +        } else if(log.isInfoEnabled()) {
>> +            log.info("PortletContainer already initialized");
>>         }
>>
>> -        log ("Ready to serve you.");
>> +        log.debug("Ready to serve you.");
>>     }
>>
>>     public void destroy()
>>     {
>> +        if(log.isInfoEnabled())
>> +            log.info("Shutting down portlet container. . .");
>>         try
>>         {
>>             PortletContainerFactory.
>> @@ -237,10 +242,5 @@
>>     {
>>         doGet (request, response);
>>     }
>> -
>> -    // --- PRIVATE MEMBERS --- //
>> -
>> -
>> -    private static boolean IS_DEBUG_ENABLED;
>>
>> }
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java,v 
>>
>> retrieving revision 1.3
>> diff -u -r1.3 PortletFragment.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java    
>> 9 Feb 2004 15:42:16 -0000    1.3
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java    
>> 16 Feb 2004 04:14:14 -0000
>> @@ -93,11 +93,12 @@
>> import org.apache.pluto.portalImpl.factory.FactoryAccess;
>> import org.apache.pluto.portalImpl.om.window.impl.PortletWindowImpl;
>> import 
>> org.apache.pluto.portalImpl.services.portletentityregistry.PortletEntityRegistry; 
>>
>> +import org.apache.pluto.portalImpl.services.log.Log;
>> import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
>> import org.apache.pluto.portalImpl.util.ObjectID;
>> import org.apache.pluto.services.information.DynamicInformationProvider;
>> import org.apache.pluto.services.information.PortalContextProvider;
>> -import org.apache.pluto.services.log.Log;
>> +import org.apache.pluto.services.log.Logger;
>>
>> /**
>>  * <p>Responsible for rendering a single Portlet.<p>
>> @@ -117,6 +118,7 @@
>> public class PortletFragment extends AbstractFragmentSingle {
>>         private PortletWindow portletWindow = null;
>> +    private Logger log = null;
>>
>>     public static final String PORTLET_ERROR_MSG = "Error occurred in 
>> portlet!";
>>
>> @@ -128,6 +130,7 @@
>>             throws Exception
>>     {
>>         super(id, config, parent, fragDesc, navigation);
>> +        log = Log.getService().getLogger(getClass());
>>         String portletEntityId = 
>> getInitParameters().getString("portlet");
>>         PortletEntity portletEntity = 
>> PortletEntityRegistry.getPortletEntity(ObjectID.createFromString(portletEntityId)); 
>>
>>         portletWindow = new PortletWindowImpl(getId());
>> @@ -151,12 +154,12 @@
>>         try {
>>             
>> PortletContainerFactory.getPortletContainer().portletLoad(portletWindow, 
>> wrappedRequest, response);
>>         } catch (PortletContainerException e) {
>> -            Log.error("Error in Portlet", e);
>> +            log.error("Error in Portlet", e);
>>             errorMsg = getErrorMsg();
>>         } catch (Throwable t) {
>>             // If we catch any throwable, we want to try to continue
>>             // so that the rest of the portal renders correctly
>> -            Log.error("Error in Portlet", t);
>> +            log.error("Error in Portlet", t);
>>             if (t instanceof VirtualMachineError) {
>>                 // if the Throwable is a VirtualMachineError then
>>                 // it is very unlikely (!) that the portal is going
>> @@ -198,7 +201,7 @@
>>                 // render the Portlet to the wrapped response, to be 
>> output later.
>>                 
>> PortletContainerFactory.getPortletContainer().renderPortlet(portletWindow, 
>> wrappedRequest, wrappedResponse);
>>             } catch (UnavailableException e) {
>> -                Log.error("Portlet is Unavailable", e);
>> +                log.error("Portlet is Unavailable", e);
>>                 writer2.println("the portlet is currently 
>> unavailable!");
>>
>>                 ServletDefinitionCtrl servletDefinitionCtrl = 
>> (ServletDefinitionCtrl) 
>> ControllerObjectAccess.get(portletWindow.getPortletEntity().getPortletDefinition().getServletDefinition()); 
>>
>> @@ -212,7 +215,7 @@
>>                     
>> servletDefinitionCtrl.setAvailable(System.currentTimeMillis() + 
>> unavailableSeconds * 1000);
>>                 }
>>             } catch (Exception e) {
>> -                Log.error("Error in Portlet", e);
>> +                log.error("Error in Portlet", e);
>>                 writer2.println(getErrorMsg());
>>             }
>>             String dyn_title = ((DynamicTitleServiceImpl) 
>> FactoryAccess.getDynamicTitleContainerService()).getDynamicTitle(portletWindow, 
>> request);
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 PreferenceSetImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java    
>> 7 Jan 2004 20:37:16 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java    
>> 16 Feb 2004 04:14:15 -0000
>> @@ -67,13 +67,19 @@
>> import org.apache.pluto.om.common.PreferenceSet;
>> import org.apache.pluto.om.common.PreferenceSetCtrl;
>> import org.apache.pluto.util.StringUtils;
>> -import org.apache.pluto.services.log.Log;
>> +import org.apache.pluto.portalImpl.services.log.Log;
>> +import org.apache.pluto.services.log.Logger;
>>
>> public class PreferenceSetImpl extends HashSet
>> implements PreferenceSet, PreferenceSetCtrl, java.io.Serializable {
>>
>>     private String castorPreferencesValidator;     private 
>> ClassLoader classLoader;
>> +    private Logger log = null;
>> +
>> +    public PreferenceSetImpl() {
>> +        this.log = Log.getService().getLogger(getClass());
>> +    }
>>
>>     // PreferenceSet implementation.
>>
>> @@ -102,10 +108,9 @@
>>             if (validator instanceof PreferencesValidator)
>>                 return(PreferencesValidator)validator;
>>             else
>> -                
>> Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", 
>> -                          "Specified class " + 
>> castorPreferencesValidator +" is no preferences validator.");
>> +                log.error("Specified class " + 
>> castorPreferencesValidator +" is no preferences validator.");
>>         } catch (Exception e) {
>> -            
>> Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", 
>> e.getMessage(), e);
>> +            log.error(e.getMessage(), e);
>>         }
>>
>>         return null;
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 FragmentImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java    
>> 7 Jan 2004 20:37:20 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java    
>> 16 Feb 2004 04:14:15 -0000
>> @@ -160,8 +160,7 @@
>>         org.apache.pluto.portalImpl.aggregation.Fragment fragment = 
>> null;
>>         if (classname == null) {
>>             if (type == null) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "No type defined in pageregistry.xml");
>> +                Log.error("No type defined in pageregistry.xml");
>>                 return null;
>>             }
>>             if (type.equalsIgnoreCase("page")) {
>> @@ -189,8 +188,7 @@
>>                                                                                        
>> this,
>>                                                                                        
>> nav);
>>             } else {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Unknown type "+type+" defined in 
>> pageregistry.xml");
>> +                Log.error("Unknown type "+type+" defined in 
>> pageregistry.xml");
>>                 return null;
>>             }
>>         } else {
>> @@ -206,12 +204,10 @@
>>             try {
>>                 constructor = 
>> Class.forName(classname).getConstructor(parameterClasses);
>>             } catch (NoSuchMethodException e) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Invalid class or classname defined in 
>> pageregistry.xml",e);
>> +                Log.error("Invalid class or classname defined in 
>> pageregistry.xml",e);
>>                 return null;
>>             } catch (ClassNotFoundException e) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Invalid class or classname defined in 
>> pageregistry.xml",e);
>> +                Log.error("Invalid class or classname defined in 
>> pageregistry.xml",e);
>>                 return null;
>>             }
>>             Object[] parameters = {
>> @@ -224,22 +220,18 @@
>>             try {
>>                 Object _fragment = constructor.newInstance(parameters);
>>                 if (!(_fragment instanceof 
>> org.apache.pluto.portalImpl.aggregation.Fragment)) {
>> -                    Log.error("org.apache.pluto.portalImpl",
>> -                              "Invalid class or classname defined in 
>> pageregistry.xml");
>> +                    Log.error("Invalid class or classname defined in 
>> pageregistry.xml");
>>                     return null;
>>                 }
>>                 fragment = 
>> (org.apache.pluto.portalImpl.aggregation.Fragment)_fragment;
>>             } catch (InstantiationException e) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Invalid class or classname defined in 
>> pageregistry.xml",e);
>> +                Log.error("Invalid class or classname defined in 
>> pageregistry.xml",e);
>>                 return null;
>>             } catch (IllegalAccessException e) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Invalid class or classname defined in 
>> pageregistry.xml",e);
>> +                Log.error("Invalid class or classname defined in 
>> pageregistry.xml",e);
>>                 return null;
>>             } catch (InvocationTargetException e) {
>> -                Log.error("org.apache.pluto.portalImpl",
>> -                          "Invalid class or classname defined in 
>> pageregistry.xml",e);
>> +                Log.error("Invalid class or classname defined in 
>> pageregistry.xml",e);
>>                 return null;
>>             }
>>         }        Index: 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 ServletDefinitionImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java    
>> 7 Jan 2004 20:37:23 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java    
>> 16 Feb 2004 04:14:17 -0000
>> @@ -147,13 +147,11 @@
>>     {
>>         ServletContext newContext = 
>> webApplication.getServletContext(servletContext);
>>         if (newContext==null) {
>> -            Log.error("org.apache.pluto.portalImpl",
>> -                      "ServletContext 
>> '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' 
>> not found!");
>> +            Log.error("ServletContext 
>> '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' 
>> not found!");
>>             return null;
>>         }
>> -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
>> -            Log.debug("org.apache.pluto.portalImpl",
>> -                      "Looking up RequestDispatcher for servlet 
>> mapping "+servletMapping.getUrlPattern());
>> +        if (Log.isDebugEnabled()) {
>> +            Log.debug("Looking up RequestDispatcher for servlet 
>> mapping "+servletMapping.getUrlPattern());
>>         }
>>         return 
>> newContext.getRequestDispatcher(servletMapping.getUrlPattern());
>>     }
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 WebApplicationDefinitionImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java    
>> 7 Jan 2004 20:37:23 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java    
>> 16 Feb 2004 04:14:17 -0000
>> @@ -147,9 +147,8 @@
>>
>>     public ServletContext getServletContext(ServletContext 
>> servletContext)
>>     {
>> -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
>> -            Log.debug("org.apache.pluto.portalImpl",
>> -                      "Looking up ServletContext for path 
>> "+contextPath);
>> +        if (Log.isDebugEnabled()) {
>> +            Log.debug("Looking up ServletContext for path 
>> "+contextPath);
>>         }
>>         return servletContext.getContext(contextPath);
>>     }
>> Index: portal/src/java/org/apache/pluto/portalImpl/services/Service.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/Service.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 Service.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/Service.java    
>> 7 Jan 2004 20:37:20 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/Service.java    
>> 16 Feb 2004 04:14:17 -0000
>> @@ -61,9 +61,6 @@
>> import javax.servlet.ServletContext;
>>
>> import org.apache.pluto.portalImpl.util.Properties;
>> -import org.apache.pluto.util.StringUtils;
>> -
>> -import org.apache.pluto.portalImpl.services.log.*;
>>
>> /**
>>  ** This is the base class for all services of the system. It prototypes
>> @@ -85,23 +82,11 @@
>> public abstract class Service
>> {
>>
>> -
>> -    protected final boolean IS_DEBUG_ENABLED;
>> -
>>     /**
>>      ** Constructs the service.
>>      **/
>> +    protected Service () {
>>
>> -    protected Service ()
>> -    {
>> -        if (ServiceManager.getService (LogService.class) != null)
>> -        {
>> -            IS_DEBUG_ENABLED = Log.isDebugEnabled 
>> (StringUtils.packageOf (getClass ()));
>> -        }
>> -        else
>> -        {
>> -            IS_DEBUG_ENABLED = true;
>> -        }
>>     }
>>
>>     /**
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 ServiceManager.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java    
>> 7 Jan 2004 20:37:20 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java    
>> 16 Feb 2004 04:14:18 -0000
>> @@ -68,7 +68,7 @@
>>
>> /**
>>  * Manages the life-time of services registered during servlet startup.
>> - * A service has to derive from {@link ContainerService} and 
>> implement the
>> + * A service has to derive from {@link 
>> org.apache.pluto.services.ContainerService} and implement the
>>  * <CODE>init()</CODE> and <CODE>destroy()</CODE> methods as 
>> appropriate.
>>  *  * <P>
>> @@ -77,7 +77,7 @@
>>  * available to the portal engine. The format of the file is simple:
>>  *  * <PRE>
>> - *   org.apache.pluto.portalImpl.services.log.LogService = 
>> org.apache.pluto.portalImpl.services.log.LogServicesImpl
>> + *   org.apache.pluto.portalImpl.services.log.Logger = 
>> org.apache.pluto.portalImpl.services.log.LogServicesImpl
>>  * </PRE>
>>  *  * Each entry represents one service. The left-hand side is the 
>> abstract
>> @@ -89,7 +89,8 @@
>>  * <CODE>/config/services</CODE>. It has to have the name of either
>>  * implementation or abstract class of the service, without the
>>  * leading package name. For example, the service manager looks
>> - * for <CODE>LogServiceImpl.properties</CODE>. This allows a special
>> + * for <CODE>LoggerImpl
>> +.properties</CODE>. This allows a special
>>  * implementation to provide different configuration than the
>>  * general (abstract) service requires.
>>  * @@ -99,7 +100,7 @@
>>  * object. Not providing a service configuration file is okay too,
>>  * in that case the properties are empty.
>>  * - * @see ContainerService
>> + * @see org.apache.pluto.services.ContainerService
>>  */
>> public class ServiceManager
>> {
>> Index: portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 Log.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java    
>> 7 Jan 2004 20:37:22 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java    
>> 16 Feb 2004 04:14:19 -0000
>> @@ -58,76 +58,80 @@
>> package org.apache.pluto.portalImpl.services.log;
>>
>> import org.apache.pluto.portalImpl.services.ServiceManager;
>> +import org.apache.pluto.services.log.Logger;
>>
>> /**
>> - ** This is the static accessor for the <code>LogService</code>.
>> + ** This is the static accessor for the <code>Logger</code>.
>> + ** All log messages logged using this classes static log
>> + ** methods log to the org.apache.pluto.portalImpl category.
>>  **
>> - ** @see   LogService
>> + ** @see   org.apache.pluto.services.log.Logger
>>  **/
>>
>> public class Log
>> {
>>
>> +    private static Logger log =
>> +        getService().getLogger("org.apache.pluto.portalImpl");
>>
>> -    public static boolean isDebugEnabled (String aComponent)
>> -    {
>> -        return (cService.isDebugEnabled (aComponent));
>> +    public static boolean isDebugEnabled() {
>> +        return log.isDebugEnabled();
>>     }
>>
>> -    public static boolean isInfoEnabled (String aComponent)
>> -    {
>> -        return (cService.isInfoEnabled (aComponent));
>> +    public static boolean isInfoEnabled() {
>> +        return log.isInfoEnabled();
>>     }
>>
>> -    public static boolean isWarnEnabled (String aComponent)
>> -    {
>> -        return (cService.isWarnEnabled (aComponent));
>> +    public static boolean isWarnEnabled() {
>> +        return log.isWarnEnabled();
>>     }
>>
>> -    public static boolean isErrorEnabled (String aComponent)
>> -    {
>> -        return (cService.isErrorEnabled (aComponent));
>> +    public static boolean isErrorEnabled() {
>> +        return log.isErrorEnabled();
>>     }
>>
>> -    public static void debug (String aComponent, String aMessage)
>> -    {
>> -        cService.debug (aComponent, aMessage);
>> +    public static void debug(String aMessage) {
>> +        log.debug(aMessage);
>>     }
>>
>> -    public static void debug (String aComponent, String aMessage, 
>> Throwable aThrowable)
>> -    {
>> -        cService.debug (aComponent, aMessage, aThrowable);
>> +    public static void debug(String aMessage, Throwable aThrowable) {
>> +        log.debug(aMessage, aThrowable);
>>     }
>>
>> -    public static void info (String aComponent, String aMessage)
>> -    {
>> -        cService.info (aComponent, aMessage);
>> +    public static void info(String aMessage) {
>> +        log.info(aMessage);
>>     }
>>
>> -    public static void warn (String aComponent, String aMessage)
>> -    {
>> -        cService.warn (aComponent, aMessage);
>> +    public static void warn(String aMessage) {
>> +        log.warn(aMessage);
>>     }
>>
>> -    public static void error (String aComponent, String aMessage)
>> -    {
>> -        cService.error (aComponent, aMessage, null);
>> +    public static void error(String aMessage) {
>> +        log.error(aMessage);
>>     }
>>
>> -    public static void error (String aComponent, String aMessage, 
>> Throwable aThrowable)
>> -    {
>> -        cService.error (aComponent, aMessage, aThrowable);
>> +    public static void error(String aMessage, Throwable aThrowable) {
>> +        log.error(aMessage, aThrowable);
>>     }
>>
>> -    public static void error (String aComponent, Throwable aThrowable)
>> -    {
>> -        cService.error (aComponent, aThrowable);
>> +    public static void error(Throwable aThrowable) {
>> +        log.error(aThrowable);
>>     }
>>
>> -    public static LogService getService()
>> -    {
>> -        return cService;
>> +    /** Returns the LogService which has been registered
>> +     *  with the ServiceManager. If one does not yet exist,
>> +     *  the StandardOutLogService (LogServiceImpl) is
>> +     *  and returned.  This must take place since the
>> +     *  Deployer (which does not register services) requires
>> +     *  a valid log.
>> +     * @return
>> +     */
>> +    public static LogService getService() {
>> +        LogService ls = (LogService)
>> +                ServiceManager.getService(LogService.class);
>> +        if(ls==null)
>> +            ls = StandardOutLogService.getInstance();
>> +        return ls;
>>     }
>>
>> -    private final static LogService cService = (LogService) 
>> ServiceManager.getService (LogService.class);
>> }
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 LogService.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java    
>> 7 Jan 2004 20:37:22 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java    
>> 16 Feb 2004 04:14:19 -0000
>> @@ -59,30 +59,10 @@
>>
>> import org.apache.pluto.portalImpl.services.Service;
>>
>> +/** Defines the PortalDrivers LogService implementation
>> + *  for pluto.
>> + */
>> public abstract class LogService extends Service
>> -implements org.apache.pluto.services.log.LogService
>> -{
>> -
>> -    // org.apache.pluto.services.log.LogService implementation.
>> -    public abstract boolean isDebugEnabled (String aComponent);
>> -    -    public abstract boolean isInfoEnabled (String aComponent);
>> -    -    public abstract boolean isWarnEnabled (String aComponent);
>> -
>> -    public abstract boolean isErrorEnabled (String aComponent);
>> -
>> -
>> -    public abstract void debug (String aComponent, String aMessage);
>> -
>> -    public abstract void debug (String aComponent, String aMessage, 
>> Throwable aThrowable);
>> -
>> -    public abstract void info (String aComponent, String aMessage);
>> -
>> -    public abstract void warn (String aComponent, String aMessage);
>> -
>> -    public abstract void error (String aComponent, String aMessage, 
>> Throwable aThrowable);
>> -
>> -    public abstract void error (String aComponent, Throwable 
>> aThrowable);
>> +implements org.apache.pluto.services.log.LogService {
>>
>> }
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 LogServiceImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java    
>> 7 Jan 2004 20:37:22 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java    
>> 16 Feb 2004 04:14:20 -0000
>> @@ -58,88 +58,35 @@
>> package org.apache.pluto.portalImpl.services.log;
>>
>> import org.apache.pluto.portalImpl.util.Properties;
>> +import org.apache.pluto.portalImpl.services.Service;
>> +import org.apache.pluto.services.log.*;
>> +import org.apache.pluto.services.log.Logger;
>> +import org.apache.commons.logging.LogFactory;
>> +
>> +/** LogService implementation which uses Commons Logging.
>> + *  The use of commons logging provides us with a simple yet
>> + *  effective way to abstract the logging implementation.  Commons
>> + *  Logging will be initialized in it's default manner according
>> + *  to: http://jakarta.apache.org/commons/logging/userguide.html.
>> + *
>> + *  If no configuraiton is found, Commons Logging will use it's
>> + *  SimpleLog configuration, which will log everything to standard
>> + *  error.
>> + */
>> +public class LogServiceImpl
>> +    extends LogService {
>> +
>> +    public Logger getLogger(String component) {
>> +        return new LoggerImpl(
>> +            LogFactory.getLog(component)
>> +        );
>>
>> -public class LogServiceImpl extends LogService
>> -{
>> -
>> -    public void init (Properties aProperties)
>> -    {
>> -        iIsDebugEnabled = aProperties.getBoolean ("debug.enable", 
>> Boolean.FALSE).booleanValue ();
>> -        iIsInfoEnabled  = aProperties.getBoolean ("info.enable", 
>> Boolean.FALSE).booleanValue ();
>> -        iIsWarnEnabled  = aProperties.getBoolean ("warn.enable", 
>> Boolean.FALSE).booleanValue ();
>> -        iIsErrorEnabled = aProperties.getBoolean ("error.enable", 
>> Boolean.FALSE).booleanValue ();
>> -    }
>> -
>> -    public boolean isDebugEnabled (String aComponent)
>> -    {
>> -        return (iIsDebugEnabled);
>> -    }
>> -
>> -    public boolean isInfoEnabled (String aComponent)
>> -    {
>> -        return (iIsInfoEnabled);
>> -    }
>> -
>> -    public boolean isWarnEnabled (String aComponent)
>> -    {
>> -        return (iIsWarnEnabled);
>> -    }
>> -
>> -    public boolean isErrorEnabled (String aComponent)
>> -    {
>> -        return (iIsErrorEnabled);
>> -    }
>> -
>> -    public void debug (String aComponent, String aMessage)
>> -    {
>> -        if (iIsDebugEnabled)
>> -        {
>> -            System.out.println ("DEBUG  " + aComponent + "   " + 
>> aMessage);
>> -        }
>> -    }
>> -
>> -    public void debug (String aComponent, String aMessage, Throwable 
>> aThrowable)
>> -    {
>> -        if (iIsDebugEnabled)
>> -        {
>> -            System.out.println ("DEBUG  " + aComponent + "   " + 
>> aMessage);
>> -        }
>> -    }
>> -
>> -    public void info (String aComponent, String aMessage)
>> -    {
>> -        if (iIsInfoEnabled)
>> -        {
>> -            System.out.println ("INFO   " + aComponent + "   " + 
>> aMessage);
>> -        }
>> -    }
>> -
>> -    public void warn (String aComponent, String aMessage)
>> -    {
>> -        if (iIsWarnEnabled)
>> -        {
>> -            System.out.println ("WARN   " + aComponent + "   " + 
>> aMessage);
>> -        }
>> -    }
>> -
>> -    public void error (String aComponent, String aMessage, Throwable 
>> aThrowable)
>> -    {
>> -        if (iIsErrorEnabled)
>> -        {
>> -            System.out.println ("ERROR  " + aComponent + "   " + 
>> aMessage);
>> -
>> -            if (aThrowable != null)
>> -                aThrowable.printStackTrace (System.out);
>> -        }
>>     }
>>
>> -    public void error (String aComponent, Throwable aThrowable)
>> -    {
>> -        error (aComponent, "An exception has been thrown:", 
>> aThrowable);
>> +    public Logger getLogger(Class klass) {
>> +        return new LoggerImpl(
>> +            LogFactory.getLog(klass)
>> +        );
>>     }
>>
>> -    private boolean iIsDebugEnabled;
>> -    private boolean iIsInfoEnabled;
>> -    private boolean iIsWarnEnabled;
>> -    private boolean iIsErrorEnabled;
>> }
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 PageRegistryServiceFileImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java    
>> 7 Jan 2004 20:37:23 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java    
>> 16 Feb 2004 04:14:21 -0000
>> @@ -70,6 +70,7 @@
>> import org.apache.pluto.portalImpl.om.page.impl.PortalImpl;
>> import org.apache.pluto.portalImpl.services.log.Log;
>> import org.apache.pluto.portalImpl.util.Properties;
>> +import org.apache.pluto.services.log.Logger;
>> import org.exolab.castor.mapping.Mapping;
>> import org.exolab.castor.xml.Marshaller;
>> import org.exolab.castor.xml.Unmarshaller;
>> @@ -97,12 +98,14 @@
>>     // Root element
>>     private PortalImpl registry = null;
>>     private RootFragment root = null;
>> +    private Logger log = null;
>>
>>     private HashMap fragments = new HashMap();
>>
>>     public void init (ServletConfig config, Properties properties) 
>> throws Exception
>>     {                servletContext = config.getServletContext();
>> +        log = Log.getService().getLogger(getClass());
>>
>>         String _mapping = properties.getString(CONFIG_MAPPING, 
>> DEFAULT_MAPPING);
>>         File f = new File(_mapping);
>> @@ -116,19 +119,16 @@
>>         }
>>         catch (Exception e)
>>         {
>> -            Log.error("org.apache.pluto.portalImpl.services", 
>> -                      "Failed to load mapping file "+_mapping,e);
>> +            log.error("Failed to load mapping file "+_mapping,e);
>>             throw e;
>>         }
>>
>>         load();
>>
>> -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +        if (log.isDebugEnabled())
>>         {
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      "Dumping complete object model description as 
>> it is read from the xml file...");
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      registry.toString());
>> +            log.debug("Dumping complete object model description as 
>> it is read from the xml file...");
>> +            log.debug(registry.toString());
>>         }            }
>>
>> @@ -136,12 +136,10 @@
>>                 root = registry.build(config);
>>              -        if 
>> (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +        if (log.isDebugEnabled())
>>         {
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      "Dumping complete navigation tree created of 
>> the object model...");
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      root.getNavigation().toString());
>> +            log.debug("Dumping complete navigation tree created of 
>> the object model...");
>> +            log.debug(root.getNavigation().toString());
>>         }
>>     }
>>
>> @@ -163,7 +161,7 @@
>>         } else {
>>
>>             String msg = "Fragment with this name "+id+" already 
>> exists in the pageregistry.xml.";
>> -            Log.error("org.apache.pluto.portalImpl.services", msg);
>> +            log.error(msg);
>>             throw new Exception(msg);
>>         }
>>
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 PortletDefinitionRegistryServiceFileImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java    
>> 7 Jan 2004 20:37:24 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java    
>> 16 Feb 2004 04:14:21 -0000
>> @@ -77,6 +77,7 @@
>> import org.apache.pluto.portalImpl.services.log.Log;
>> import org.apache.pluto.portalImpl.util.Properties;
>> import org.apache.pluto.portalImpl.xml.XmlParser;
>> +import org.apache.pluto.services.log.Logger;
>> import org.exolab.castor.mapping.Mapping;
>> import org.exolab.castor.xml.Unmarshaller;
>> import org.xml.sax.InputSource;
>> @@ -106,6 +107,7 @@
>>     private ServletContext servletContext = null;
>>     // Base Dir where all web modules are located
>>     private String baseWMDir = null;
>> +    private Logger log = null;
>>
>>     // Helper lists and hashtables to access the data as fast as 
>> possible
>>     // List containing all portlet applications available in the system
>> @@ -115,6 +117,7 @@
>>
>>     public void init (ServletConfig config, Properties properties) 
>> throws Exception
>>     {
>> +        log = Log.getService().getLogger(getClass());
>>         servletContext = config.getServletContext();
>>
>>         if (properties.getBoolean("non-servlet")==Boolean.TRUE)
>> @@ -123,7 +126,8 @@
>>             baseWMDir = root + fileSeparator +         "WEB-INF" + 
>> fileSeparator +         "portletapps" + fileSeparator; 
>> //org.apache.pluto.portalImpl.services.deploy.DeployServiceFileImpl.DEFAULT_PROTECTED; 
>>
>> -            
>> Log.debug("org.apache.pluto.portalImpl.services.Portletregistry", 
>> "baseWMDir = " + baseWMDir + " fileSeparator = " + fileSeparator);
>> +            if(log.isDebugEnabled())
>> +                log.debug("baseWMDir = " + baseWMDir + " 
>> fileSeparator = " + fileSeparator);
>>         }
>>         else
>>         {
>> @@ -143,8 +147,7 @@
>>         }
>>         catch (Exception e)
>>         {
>> -            Log.error("org.apache.pluto.portalImpl.services", 
>> -                      "Failed to load mapping file "+_mapping,e);
>> +            log.error("Failed to load mapping file "+_mapping,e);
>>             throw e;
>>         }
>>         // get web xml mapping file
>> @@ -158,8 +161,7 @@
>>         }
>>         catch (Exception e)
>>         {
>> -            Log.error("org.apache.pluto.portalImpl.services", 
>> -                      "Failed to load mapping file "+_mapping,e);
>> +            log.error("Failed to load mapping file "+_mapping,e);
>>             throw e;
>>         }
>>
>> @@ -203,10 +205,9 @@
>>         // portlet application web module
>>         if (portletXml.exists()) // && (webXml.exists()))
>>         {
>> -            if 
>> (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +            if (log.isDebugEnabled())
>>             {
>> -                Log.debug("org.apache.pluto.portalImpl.services", 
>> -                          "Loading the following Portlet 
>> Applications XML files..."+portletXml+", "+webXml);
>> +                log.debug("Loading the following Portlet 
>> Applications XML files..."+portletXml+", "+webXml);
>>             }
>>
>>             InputSource source = new InputSource(new 
>> FileInputStream(portletXml));
>> @@ -240,16 +241,16 @@
>>
>>                 webApp.postBuild(structure);
>>
>> -                if 
>> (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +                if (log.isDebugEnabled())
>>                 {
>> -                    
>> Log.debug("org.apache.pluto.portalImpl.services", webApp.toString());
>> +                    log.debug(webApp.toString());
>>                 }
>>             }
>>             else
>>             {
>> -                if 
>> (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +                if (log.isDebugEnabled())
>>                 {
>> -                    
>> Log.debug("org.apache.pluto.portalImpl.services", "no web.xml...");
>> +                    log.debug("no web.xml...");
>>                 }
>>                 Vector structure = new Vector();
>>                 structure.add("/" + webModule);
>> @@ -265,19 +266,15 @@
>>
>>             registry.add( portletApp );
>>
>> -            if 
>> (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +            if (log.isDebugEnabled())
>>             {
>>                 if (webApp!=null)
>>                 {
>> -                    
>> Log.debug("org.apache.pluto.portalImpl.services", 
>> -                              "Dumping content of web.xml...");
>> -                    
>> Log.debug("org.apache.pluto.portalImpl.services", 
>> -                              webApp.toString());
>> +                    log.debug("Dumping content of web.xml...");
>> +                    log.debug(webApp.toString());
>>                 }
>> -                Log.debug("org.apache.pluto.portalImpl.services", 
>> -                          "Dumping content of portlet.xml...");
>> -                Log.debug("org.apache.pluto.portalImpl.services", 
>> -                          portletApp.toString());
>> +                log.debug("Dumping content of portlet.xml...");
>> +                log.debug(portletApp.toString());
>>             }
>>         }
>>
>> Index: 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java 
>>
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 PortletEntityRegistryServiceFileImpl.java
>> --- 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java    
>> 7 Jan 2004 20:37:20 -0000    1.1
>> +++ 
>> portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java    
>> 16 Feb 2004 04:14:23 -0000
>> @@ -75,6 +75,7 @@
>> import 
>> org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityListImpl; 
>>
>> import org.apache.pluto.portalImpl.services.log.Log;
>> import org.apache.pluto.portalImpl.util.Properties;
>> +import org.apache.pluto.services.log.Logger;
>> import org.exolab.castor.mapping.Mapping;
>> import org.exolab.castor.xml.Marshaller;
>> import org.exolab.castor.xml.Unmarshaller;
>> @@ -99,6 +100,7 @@
>>     protected Mapping mapping = null;
>>     // Servlet Context
>>     protected ServletContext servletContext = null;
>> +    private Logger log = null;
>>     // Registry
>>     protected PortletApplicationEntityListImpl registry = null;
>>     @@ -108,6 +110,7 @@
>>     public void init (ServletConfig servletConfig, Properties 
>> properties) throws Exception
>>     {
>>         servletContext = servletConfig.getServletContext();
>> +        log = Log.getService().getLogger(getClass());
>>
>>         String _mapping = properties.getString(CONFIG_MAPPING, 
>> DEFAULT_MAPPING);
>>         File f = new File(_mapping);
>> @@ -121,7 +124,7 @@
>>         }
>>         catch (Exception e)
>>         {
>> -            Log.error("Failed to load mapping file "+_mapping,e);
>> +            log.error("Failed to load mapping file "+_mapping,e);
>>             throw e;
>>         }
>>     @@ -185,12 +188,10 @@
>>     {
>>         _load();
>>
>> -        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>> +        if (log.isDebugEnabled())
>>         {
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      "Dumping complete object model description as 
>> it is read from the xml file...");
>> -            Log.debug("org.apache.pluto.portalImpl.services", 
>> -                      registry.toString());
>> +            log.debug("Dumping complete object model description as 
>> it is read from the xml file...");
>> +            log.debug(registry.toString());
>>         }
>>
>>         fill();
>> Index: portal/src/webapp/WEB-INF/config/services.properties
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-pluto/portal/src/webapp/WEB-INF/config/services.properties,v 
>>
>> retrieving revision 1.1
>> diff -u -r1.1 services.properties
>> --- portal/src/webapp/WEB-INF/config/services.properties    7 Jan 
>> 2004 20:37:19 -0000    1.1
>> +++ portal/src/webapp/WEB-INF/config/services.properties    16 Feb 
>> 2004 04:14:23 -0000
>> @@ -4,9 +4,8 @@
>>
>> org.apache.pluto.portalImpl.services.config.ConfigService = 
>> org.apache.pluto.portalImpl.services.config.ConfigServiceImpl
>>
>> -# LogServiceImpl writes to System.out. LogServiceCommonsLoggingImpl 
>> uses commons-logging
>> -#org.apache.pluto.portalImpl.services.log.LogService = 
>> org.apache.pluto.portalImpl.services.log.LogServiceImpl
>> -org.apache.pluto.portalImpl.services.log.LogService = 
>> org.apache.pluto.portalImpl.services.log.LogServiceCommonsLoggingImpl
>> +org.apache.pluto.portalImpl.services.log.LogService= 
>> org.apache.pluto.portalImpl.services.log.LogServiceImpl
>> +
>>
>> org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerService 
>> = 
>> org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerServiceImpl 
>>
>>
>>  
>>
>
>



Re: [Patch] Logging Enhancements

Posted by Michael Blum <bl...@apache.org>.
David,

I applied your patches and imported the new java files. Everything works 
well. Good job. I am going to commit your changes for you.

By the way I have not found any comment from you about the following 
classes:
  jakarta-pluto/container/src/java/org/apache/pluto/services/log/Log.java
  
jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceCommonsLoggingImpl.java
I think these two classes are now obsolete, right? Is it correct to 
delete them?

Michael

David H. DeWolf wrote:

> I have implemented the logging enhancements we agreed to in the thread 
> below:
>
> http://nagoya.apache.org/eyebrowse/BrowseList?listName=pluto-dev@jakarta.apache.org&by=thread&from=634810 
>
>
> Everything needed to apply the patch is enclosed - including:
> 1. Diff of all that has changed
> 2. New class files
>
> Here is a recap of what has changed:
>
> Container Changes:
> ------------------------------------
> LogService interface has changed in the following ways in order for 
> the LogService to act as a factory for logging implementations :
> 1) All isXXXEnabled() methods have been removed
> 2) All logging methods have been removed
> 3) getLogger(String) and getLogger(Class) have been added.
>
> Logger interface has been added.  It includes:
> 1) All isXXXEnabled() methods
> 2) All logging methods removed from LogService
>
> Finally, All pluto classes which log now lookup a Logger using the 
> LogService implementation provided by the container's environment.  
> Because of this, the static Log class can and should be removed.
>
> Portal Driver changes:
> ---------------------------------
> The LogServiceImpl has been modified to implement the new version of 
> pluto's LogService interface.   It returns Loggers of type LoggerImpl
>
> LoggerImpl has been created.  It utilizes commons logging for all 
> logging functions.
>
> Where possible (and where it makes sense), all driver classes that 
> utilize significant logging grab their own instance of Logger and use 
> it for logging.  Each instance access the LogService directly from the 
> driver's ServiceManager (instead of looking it up through the 
> containers abstractions -- which would eventually bring it back to the 
> ServiceManager anyways.
>
> The driver's Log class has been modified so that all static 
> invocations utilize a single Logger (org.apache.pluto.portalImpl) and 
> it is not looked up each time.  Because of this, the 'aComponent' 
> argument is no longer available to within static logging methods.
>
> All classes have been modified to utilize the above portal changes.
>
> Other:
> --------------------------------
> As a result of these changes, the commons logging system is used by 
> default whenever pluto is deployed.  If commons logging configuration 
> is not found, commons logging will initialize itself using the 
> "SimpleLog" . Basically, by default,  the SimpleLog writes all log 
> messages that are info and above to Standard error. Please see commons 
> logging documentation for more details.
>
> A StandardOutLogService and StandardOutLogger have been implemented 
> for use with the Deployer.  This is especially useful since the 
> Deployer does not worry about registering services with the driver's 
> ServiceManager.
>
> David
>
>------------------------------------------------------------------------
>
>/*
> * The Apache Software License, Version 1.1
> *
> * Copyright (c) 2003 The Apache Software Foundation.  All rights 
> * reserved.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> * are met:
> *
> * 1. Redistributions of source code must retain the above copyright
> *    notice, this list of conditions and the following disclaimer. 
> *
> * 2. Redistributions in binary form must reproduce the above copyright
> *    notice, this list of conditions and the following disclaimer in
> *    the documentation and/or other materials provided with the
> *    distribution.
> *
> * 3. The end-user documentation included with the redistribution, if
> *    any, must include the following acknowlegement:  
> *       "This product includes software developed by the 
> *        Apache Software Foundation (http://www.apache.org/)."
> *    Alternately, this acknowlegement may appear in the software itself,
> *    if and wherever such third-party acknowlegements normally appear.
> *
> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
> *    Foundation" must not be used to endorse or promote products derived
> *    from this software without prior written permission. For written 
> *    permission, please contact apache@apache.org.
> *
> * 5. Products derived from this software may not be called "Apache"
> *    nor may "Apache" appear in their names without prior written
> *    permission of the Apache Group.
> *
> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> * SUCH DAMAGE.
> * ====================================================================
> *
> * This software consists of voluntary contributions made by many
> * individuals on behalf of the Apache Software Foundation.  For more
> * information on the Apache Software Foundation, please see
> * <http://www.apache.org/>.
> */
>/* 
>
> */
>
>package org.apache.pluto.services.log;
>
>import org.apache.pluto.services.ContainerService;
>
>/** Implemented in order to provide component aware
> *  logging.
> *
> * @see LogService
> *
> */
>public interface Logger extends ContainerService
>{
>
>    public boolean isDebugEnabled();
>    public boolean isInfoEnabled();
>    public boolean isWarnEnabled();
>    public boolean isErrorEnabled();
>
>    public void debug(String aMessage);
>    public void debug(String aMessage, Throwable aThrowable);
>    public void info(String aMessage);
>    public void warn(String aMessage);
>    public void error(String aMessage);
>    public void error(String aMessage, Throwable aThrowable);
>    public void error(Throwable aThrowable);
>
>}
>  
>
>------------------------------------------------------------------------
>
>/*
> * The Apache Software License, Version 1.1
> *
> * Copyright (c) 2003 The Apache Software Foundation.  All rights 
> * reserved.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> * are met:
> *
> * 1. Redistributions of source code must retain the above copyright
> *    notice, this list of conditions and the following disclaimer. 
> *
> * 2. Redistributions in binary form must reproduce the above copyright
> *    notice, this list of conditions and the following disclaimer in
> *    the documentation and/or other materials provided with the
> *    distribution.
> *
> * 3. The end-user documentation included with the redistribution, if
> *    any, must include the following acknowlegement:  
> *       "This product includes software developed by the 
> *        Apache Software Foundation (http://www.apache.org/)."
> *    Alternately, this acknowlegement may appear in the software itself,
> *    if and wherever such third-party acknowlegements normally appear.
> *
> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
> *    Foundation" must not be used to endorse or promote products derived
> *    from this software without prior written permission. For written 
> *    permission, please contact apache@apache.org.
> *
> * 5. Products derived from this software may not be called "Apache"
> *    nor may "Apache" appear in their names without prior written
> *    permission of the Apache Group.
> *
> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> * SUCH DAMAGE.
> * ====================================================================
> *
> * This software consists of voluntary contributions made by many
> * individuals on behalf of the Apache Software Foundation.  For more
> * information on the Apache Software Foundation, please see
> * <http://www.apache.org/>.
> */
>/* 
>
> */
>
>package org.apache.pluto.portalImpl.services.log;
>
>import org.apache.pluto.services.log.Logger;
>
>/** Defines a LogService that may be used when
> *  one has not been registered with the ServiceManager.
> *  This is specifically usefull in cases, such as
> *  when the Deployer is run, in which no Service are
> *  registered.
> *
> *  The StandardOutLogService is implemented as a
> *  Singleton since all log messages will be going
> *  to StandardOut no matter what! Since all behaivior
> *  will be identical, there's no reason to create
> *  multiple instances.
> */
>public class StandardOutLogService extends LogService {
>
>    private static Logger logger = null;
>
>    private static LogService service;
>
>    public static LogService getInstance() {
>        if(service==null)
>            service = new StandardOutLogService();
>        return service;
>    }
>
>    private StandardOutLogService() {
>        logger = new StandardOutLogger();
>    }
>
>    public Logger getLogger(String aComponent) {
>        return logger;
>    }
>    
>    public Logger getLogger(Class klass) {
>        return logger;
>    }
>
>}
>  
>
>------------------------------------------------------------------------
>
>/*
> * The Apache Software License, Version 1.1
> *
> * Copyright (c) 2003 The Apache Software Foundation.  All rights 
> * reserved.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> * are met:
> *
> * 1. Redistributions of source code must retain the above copyright
> *    notice, this list of conditions and the following disclaimer. 
> *
> * 2. Redistributions in binary form must reproduce the above copyright
> *    notice, this list of conditions and the following disclaimer in
> *    the documentation and/or other materials provided with the
> *    distribution.
> *
> * 3. The end-user documentation included with the redistribution, if
> *    any, must include the following acknowlegement:  
> *       "This product includes software developed by the 
> *        Apache Software Foundation (http://www.apache.org/)."
> *    Alternately, this acknowlegement may appear in the software itself,
> *    if and wherever such third-party acknowlegements normally appear.
> *
> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
> *    Foundation" must not be used to endorse or promote products derived
> *    from this software without prior written permission. For written 
> *    permission, please contact apache@apache.org.
> *
> * 5. Products derived from this software may not be called "Apache"
> *    nor may "Apache" appear in their names without prior written
> *    permission of the Apache Group.
> *
> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> * SUCH DAMAGE.
> * ====================================================================
> *
> * This software consists of voluntary contributions made by many
> * individuals on behalf of the Apache Software Foundation.  For more
> * information on the Apache Software Foundation, please see
> * <http://www.apache.org/>.
> */
>/* 
>
> */
>
>package org.apache.pluto.portalImpl.services.log;
>
>import org.apache.commons.logging.Log;
>import org.apache.pluto.services.log.Logger;
>
>public class LoggerImpl implements Logger {
>
>    private Log log = null;
>
>    public LoggerImpl(Log log) {
>        this.log = log;
>    }
>
>    public boolean isDebugEnabled() {
>        return log.isDebugEnabled();
>    }
>
>    public boolean isInfoEnabled() {
>        return log.isInfoEnabled();
>    }
>
>    public boolean isWarnEnabled() {
>        return log.isWarnEnabled();
>    }
>
>    public boolean isErrorEnabled() {
>        return log.isErrorEnabled();
>    }
>
>    public void debug(String aMessage) {
>        log.debug(aMessage);
>    }
>
>    public void debug(String aMessage, Throwable aThrowable) {
>        log.debug(aMessage, aThrowable);
>    }
>
>    public void info(String aMessage) {
>        log.info(aMessage);
>    }
>
>    public void warn(String aMessage) {
>        log.warn(aMessage);
>    }
>
>    public void error(String aMessage) {
>        log.error(aMessage);
>    }
>
>    public void error(String aMessage, Throwable aThrowable) {
>        log.error(aMessage);
>    }
>
>    public void error(Throwable aThrowable) {
>        log.error("Exception caught: ", aThrowable);
>    }
>
>}
>  
>
>------------------------------------------------------------------------
>
>/*
> * The Apache Software License, Version 1.1
> *
> * Copyright (c) 2003 The Apache Software Foundation.  All rights 
> * reserved.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> * are met:
> *
> * 1. Redistributions of source code must retain the above copyright
> *    notice, this list of conditions and the following disclaimer. 
> *
> * 2. Redistributions in binary form must reproduce the above copyright
> *    notice, this list of conditions and the following disclaimer in
> *    the documentation and/or other materials provided with the
> *    distribution.
> *
> * 3. The end-user documentation included with the redistribution, if
> *    any, must include the following acknowlegement:  
> *       "This product includes software developed by the 
> *        Apache Software Foundation (http://www.apache.org/)."
> *    Alternately, this acknowlegement may appear in the software itself,
> *    if and wherever such third-party acknowlegements normally appear.
> *
> * 4. The names "The Jakarta Project", "Pluto", and "Apache Software
> *    Foundation" must not be used to endorse or promote products derived
> *    from this software without prior written permission. For written 
> *    permission, please contact apache@apache.org.
> *
> * 5. Products derived from this software may not be called "Apache"
> *    nor may "Apache" appear in their names without prior written
> *    permission of the Apache Group.
> *
> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> * SUCH DAMAGE.
> * ====================================================================
> *
> * This software consists of voluntary contributions made by many
> * individuals on behalf of the Apache Software Foundation.  For more
> * information on the Apache Software Foundation, please see
> * <http://www.apache.org/>.
> */
>/* 
>
> */
>
>package org.apache.pluto.portalImpl.services.log;
>
>import org.apache.pluto.services.log.Logger;
>
>/** An incredible simple Logger implementation which
> *  simply directs messages to StandardOut.  This Logger
> *  is only used in cases, such as in the Deployer, when
> *  no services are registered with the ServiceManager.
> */
>public class StandardOutLogger implements Logger {
>
>    public StandardOutLogger() {
>    }
>
>    public boolean isDebugEnabled() {
>        return true;
>    }
>
>    public boolean isInfoEnabled() {
>        return true;
>    }
>
>    public boolean isWarnEnabled() {
>        return true;
>    }
>
>    public boolean isErrorEnabled() {
>        return true;
>    }
>
>    public void debug(String aMessage) {
>        System.out.println(aMessage);
>    }
>
>    public void debug(String aMessage, Throwable aThrowable) {
>        System.out.println(aMessage);
>        aThrowable.printStackTrace();
>    }
>
>    public void info(String aMessage) {
>        System.out.println(aMessage);
>    }
>
>    public void warn(String aMessage) {
>        System.out.println(aMessage);
>    }
>
>    public void error(String aMessage) {
>        System.out.println(aMessage);
>    }
>
>    public void error(String aMessage, Throwable aThrowable) {
>        System.out.println(aMessage);
>        aThrowable.printStackTrace();
>    }
>
>    public void error(Throwable aThrowable) {
>        aThrowable.printStackTrace();
>    }
>
>}
>  
>
>------------------------------------------------------------------------
>
>? logging-patch-diff.txt
>? container/src/java/org/apache/pluto/services/log/Logger.java
>? portal/src/java/org/apache/pluto/portalImpl/services/log/LoggerImpl.java
>? portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogService.java
>? portal/src/java/org/apache/pluto/portalImpl/services/log/StandardOutLogger.java
>Index: container/src/java/org/apache/pluto/PortletContainerImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/PortletContainerImpl.java,v
>retrieving revision 1.2
>diff -u -r1.2 PortletContainerImpl.java
>--- container/src/java/org/apache/pluto/PortletContainerImpl.java	8 Jan 2004 02:20:16 -0000	1.2
>+++ container/src/java/org/apache/pluto/PortletContainerImpl.java	16 Feb 2004 04:14:12 -0000
>@@ -75,7 +75,8 @@
> import org.apache.pluto.services.information.DynamicInformationProvider;
> import org.apache.pluto.services.information.InformationProviderAccess;
> import org.apache.pluto.services.information.PortletURLProvider;
>-import org.apache.pluto.services.log.Log;
>+import org.apache.pluto.services.log.Logger;
>+import org.apache.pluto.services.log.LogService;
> 
> /**
>  *  Implements the Pluto Container.
>@@ -90,6 +91,8 @@
>     private Properties properties;
>     private boolean initialized;
> 
>+    private Logger log = null;
>+
>     public void init(String uniqueContainerName,
>                      ServletConfig servletConfig,
>                      PortletContainerEnvironment environment,
>@@ -101,6 +104,12 @@
>         PortletContainerServices.createReference(uniqueContainerName, environment);
>         this.properties = properties;
>         initialized = true;
>+
>+        // Initialize the Logger that we will use
>+        // from here forward for this Container:
>+        log = ((LogService)environment
>+                .getContainerService(LogService.class))
>+                .getLogger(getClass());
>     }
> 
>     public void shutdown() throws PortletContainerException
>@@ -117,10 +126,9 @@
>         PortletContainerServices.prepare(uniqueContainerName);
>         PortletInvoker invoker = null;
>         
>-        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>+        if (log.isDebugEnabled())
>         {
>-            Log.debug("org.apache.pluto.invoker",
>-                      "PortletContainerImpl.portletService(" + portletWindow.getId() + ") called.");
>+            log.debug("PortletContainerImpl.portletService(" + portletWindow.getId() + ") called.");
>         }
> 
>         try
>@@ -153,10 +161,9 @@
>         PortletContainerServices.prepare(uniqueContainerName);
>         PortletInvoker invoker = null;
> 
>-        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>+        if (log.isDebugEnabled())
>         {
>-            Log.debug("org.apache.pluto.invoker",
>-                      "PortletContainerImpl.performPortletAction(" + portletWindow.getId() + ") called.");
>+            log.debug("PortletContainerImpl.performPortletAction(" + portletWindow.getId() + ") called.");
>         }
> 
>         String location = null;
>@@ -270,9 +277,8 @@
>         PortletContainerServices.prepare(uniqueContainerName);
>         PortletInvoker invoker = null;
> 
>-        if (Log.isDebugEnabled("org.apache.pluto.invoker"))
>-            Log.debug("org.apache.pluto.invoker",
>-                      "PortletContainerImpl.portletLoad("+portletWindow.getId()+") called.");
>+        if (log.isDebugEnabled())
>+            log.debug("PortletContainerImpl.portletLoad("+portletWindow.getId()+") called.");
> 
>         RenderRequest renderRequest = PortletObjectAccess.getRenderRequest(portletWindow, 
>                                                                            servletRequest, 
>Index: container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 PortletInvokerImpl.java
>--- container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java	7 Jan 2004 20:37:23 -0000	1.1
>+++ container/src/java/org/apache/pluto/invoker/impl/PortletInvokerImpl.java	16 Feb 2004 04:14:13 -0000
>@@ -73,17 +73,27 @@
> import org.apache.pluto.core.CoreUtils;
> import org.apache.pluto.core.InternalPortletRequest;
> import org.apache.pluto.core.InternalPortletResponse;
>-import org.apache.pluto.services.log.Log;
>+import org.apache.pluto.services.log.Logger;
>+import org.apache.pluto.services.log.LogService;
> import org.apache.pluto.invoker.PortletInvoker;
> import org.apache.pluto.om.portlet.PortletDefinition;
> import org.apache.pluto.om.servlet.ServletDefinition;
>+import org.apache.pluto.PortletContainerServices;
> 
> public class PortletInvokerImpl implements PortletInvoker
> {
>     private javax.servlet.ServletConfig servletConfig;
>     private PortletDefinition portletDefinition;
> 
>-    public PortletInvokerImpl(PortletDefinition portletDefinition, 
>+    /* This Logger can be saved due to the
>+     * fact that a unique instance of PortletInvoker
>+     * will be used for each request. We load it
>+     * lazily since we only log exceptions at
>+     * this point.
>+     */
>+    private Logger log = null;
>+
>+    public PortletInvokerImpl(PortletDefinition portletDefinition,
>                               javax.servlet.ServletConfig servletConfig)
>     {
>         this.portletDefinition = portletDefinition;
>@@ -93,7 +103,7 @@
>     // org.apache.pluto.invoker.PortletInvoker implementation -------------------------------------
>     public void action(ActionRequest request, ActionResponse response) throws PortletException,IOException
>     {
>-        invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);  
>+        invoke(request,response,org.apache.pluto.Constants.METHOD_ACTION);
>     }
> 
>     public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException
>@@ -109,8 +119,7 @@
>         }
>         catch (IOException e)
>         {
>-            Log.error("org.apache.pluto.invoker",
>-                      "PortletInvokerImpl.load() - Error while dispatching portlet.",e);
>+            getLog().error("PortletInvokerImpl.load() - Error while dispatching portlet.",e);
>             throw new PortletException(e);
>         }
>     }
>@@ -150,8 +159,7 @@
>             }
>             catch (javax.servlet.UnavailableException e)
>             {
>-                Log.error("org.apache.pluto.invoker",
>-                          "PortletInvokerImpl.invoke() - Error while dispatching portlet.",e);
>+                getLog().error("PortletInvokerImpl.invoke() - Error while dispatching portlet.",e);
>                 if (e.isPermanent())
>                 {
>                     throw new javax.portlet.UnavailableException(e.getMessage());
>@@ -165,8 +173,7 @@
>             {
>                 if (e.getRootCause() != null)
>                 {
>-                    Log.error("org.apache.pluto.invoker",
>-                              "PortletInvokerImpl.render() - Error while dispatching portlet.",
>+                    getLog().error("PortletInvokerImpl.render() - Error while dispatching portlet.",
>                               e.getRootCause());
>                     if (e.getRootCause() instanceof PortletException)
>                     {
>@@ -179,8 +186,7 @@
>                 }
>                 else
>                 {
>-                    Log.error("org.apache.pluto.invoker",
>-                              "PortletInvokerImpl.invoke() - Error while dispatching portlet.",
>+                    getLog().error("PortletInvokerImpl.invoke() - Error while dispatching portlet.",
>                               e);
>                     throw new PortletException(e);
>                 }
>@@ -194,9 +200,24 @@
>         }
>         else
>         {
>-            Log.error("org.apache.pluto.invoker",
>-                      "PortletInvokerImpl.action() - Unable to find RequestDispatcher.");
>+            getLog().error("PortletInvokerImpl.action() - Unable to find RequestDispatcher.");
>         }
>     }
>     // --------------------------------------------------------------------------------------------
>+
>+    /** Provides lazy instantiation of the Logger.
>+     *  This is usefull since the log is currently only
>+     *  used when an error occurs.  B/C of this, there is
>+     *  no reason to retrieve the log until needed.
>+     * @return
>+     */
>+    private Logger getLog() {
>+        if(log==null) {
>+        // from here forward for this Container:
>+            log = ((LogService)PortletContainerServices
>+                .get(LogService.class))
>+                .getLogger(getClass());
>+        }
>+        return log;
>+    }
> }
>Index: container/src/java/org/apache/pluto/services/log/LogService.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/container/src/java/org/apache/pluto/services/log/LogService.java,v
>retrieving revision 1.1
>diff -u -r1.1 LogService.java
>--- container/src/java/org/apache/pluto/services/log/LogService.java	7 Jan 2004 20:37:17 -0000	1.1
>+++ container/src/java/org/apache/pluto/services/log/LogService.java	16 Feb 2004 04:14:13 -0000
>@@ -59,28 +59,27 @@
> 
> import org.apache.pluto.services.ContainerService;
> 
>-/**
>- * The interfaces defined in this package represent an abstract object
>- * model (OM) that is applicable for different implementations.
>- * <P>
>- * This abstraction layer helps to generalize the portlet container from
>- * special implementations like data storage and moreover it is not bound
>- * to a special implementation.
>+/** Implemented in order to provides access to
>+ *  a custom Logger implementation. The Logger
>+ *  provides component aware logging capabilities.
>+ *
>  */
>-public interface LogService extends ContainerService
>-{
>+public interface LogService extends ContainerService {
> 
>+    /** Used to retrieve a Logger implementation
>+     *  which can be used to log information for the given
>+     *  component.
>+     * @param component
>+     * @return
>+     */
>+    Logger getLogger(String component);
> 
>-    public boolean isDebugEnabled (String aComponent);
>-    public boolean isInfoEnabled (String aComponent);
>-    public boolean isWarnEnabled (String aComponent);
>-    public boolean isErrorEnabled (String aComponent);
>-
>-    public void debug (String aComponent, String aMessage);
>-    public void debug (String aComponent, String aMessage, Throwable aThrowable);
>-    public void info (String aComponent, String aMessage);
>-    public void warn (String aComponent, String aMessage);
>-    public void error (String aComponent, String aMessage, Throwable aThrowable);
>-    public void error (String aComponent, Throwable aThrowable);
>+    /** Used to retrieve a Logger implementation
>+     *  which can be used to log information for the given
>+     *  Class.
>+     * @param klass
>+     * @return
>+     */
>+    Logger getLogger(Class klass);
> 
> }
>Index: portal/src/java/org/apache/pluto/portalImpl/Servlet.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/Servlet.java,v
>retrieving revision 1.2
>diff -u -r1.2 Servlet.java
>--- portal/src/java/org/apache/pluto/portalImpl/Servlet.java	20 Jan 2004 09:30:10 -0000	1.2
>+++ portal/src/java/org/apache/pluto/portalImpl/Servlet.java	16 Feb 2004 04:14:14 -0000
>@@ -68,6 +68,7 @@
> import javax.servlet.http.HttpServletResponse;
> 
> import org.apache.pluto.PortletContainerException;
>+import org.apache.pluto.services.log.Logger;
> import org.apache.pluto.om.window.PortletWindow;
> import org.apache.pluto.portalImpl.aggregation.RootFragment;
> import org.apache.pluto.portalImpl.core.PortalControlParameter;
>@@ -76,9 +77,9 @@
> import org.apache.pluto.portalImpl.core.PortletContainerEnvironment;
> import org.apache.pluto.portalImpl.core.PortletContainerFactory;
> import org.apache.pluto.portalImpl.services.ServiceManager;
>+import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.services.factorymanager.FactoryManager;
> import org.apache.pluto.portalImpl.factory.FactoryAccess;
>-import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.services.config.Config;
> import org.apache.pluto.portalImpl.services.pageregistry.PageRegistry;
> import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
>@@ -87,9 +88,7 @@
> public class Servlet extends HttpServlet
> {
> 
>-    public Servlet ()
>-    {
>-    }
>+    private Logger log = null;
> 
>     public String getServletInfo()
>     {
>@@ -122,14 +121,19 @@
>             throw (new javax.servlet.UnavailableException ("Post initialization of one or more services failed."));
>         }
> 
>-        IS_DEBUG_ENABLED = Log.isDebugEnabled ("org.apache.pluto.portalImpl");
>+        log = Log.getService().getLogger(getClass());
> 
>         if (!PortletContainerFactory.getPortletContainer().isInitialized()) {
>-            log ("Initializing PortletContainer...");
>-    
>-            String uniqueContainerName = Config.getParameters().getString ("portletcontainer.uniquename", "pluto");
>+            String uniqueContainerName =
>+               Config.getParameters().getString("portletcontainer.uniquename", "pluto");
>+
>+            if(log.isInfoEnabled())
>+                log.info("Initializing PortletContainer ["
>+                          +uniqueContainerName+"]...");
>     
>-            PortletContainerEnvironment environment = new PortletContainerEnvironment();
>+            PortletContainerEnvironment environment
>+                = new PortletContainerEnvironment();
>+
>             environment.addContainerService(Log.getService());
>             environment.addContainerService(FactoryManager.getService());
>             environment.addContainerService(FactoryAccess.getInformationProviderContainerService());
>@@ -145,19 +149,20 @@
>             }
>             catch (PortletContainerException exc)
>             {
>-                log ("Initialization of the portlet container failed!", exc);
>-    
>+                log.error("Initialization of the portlet container failed!", exc);
>                 throw (new javax.servlet.UnavailableException ("Initialization of the portlet container failed."));
>             }
>-        } else {
>-            log("PortletContainer already initialized");
>+        } else if(log.isInfoEnabled()) {
>+            log.info("PortletContainer already initialized");
>         }
> 
>-        log ("Ready to serve you.");
>+        log.debug("Ready to serve you.");
>     }
> 
>     public void destroy()
>     {
>+        if(log.isInfoEnabled())
>+            log.info("Shutting down portlet container. . .");
>         try
>         {
>             PortletContainerFactory.
>@@ -237,10 +242,5 @@
>     {
>         doGet (request, response);
>     }
>-
>-    // --- PRIVATE MEMBERS --- //
>-
>-
>-    private static boolean IS_DEBUG_ENABLED;
> 
> }
>Index: portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java,v
>retrieving revision 1.3
>diff -u -r1.3 PortletFragment.java
>--- portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java	9 Feb 2004 15:42:16 -0000	1.3
>+++ portal/src/java/org/apache/pluto/portalImpl/aggregation/PortletFragment.java	16 Feb 2004 04:14:14 -0000
>@@ -93,11 +93,12 @@
> import org.apache.pluto.portalImpl.factory.FactoryAccess;
> import org.apache.pluto.portalImpl.om.window.impl.PortletWindowImpl;
> import org.apache.pluto.portalImpl.services.portletentityregistry.PortletEntityRegistry;
>+import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.servlet.ServletObjectAccess;
> import org.apache.pluto.portalImpl.util.ObjectID;
> import org.apache.pluto.services.information.DynamicInformationProvider;
> import org.apache.pluto.services.information.PortalContextProvider;
>-import org.apache.pluto.services.log.Log;
>+import org.apache.pluto.services.log.Logger;
> 
> /**
>  * <p>Responsible for rendering a single Portlet.<p>
>@@ -117,6 +118,7 @@
> public class PortletFragment extends AbstractFragmentSingle {
>     
>     private PortletWindow portletWindow = null;
>+    private Logger log = null;
> 
>     public static final String PORTLET_ERROR_MSG = "Error occurred in portlet!";
> 
>@@ -128,6 +130,7 @@
>             throws Exception
>     {
> 		super(id, config, parent, fragDesc, navigation);
>+        log = Log.getService().getLogger(getClass());
> 		String portletEntityId = getInitParameters().getString("portlet");
> 		PortletEntity portletEntity = PortletEntityRegistry.getPortletEntity(ObjectID.createFromString(portletEntityId));
> 		portletWindow = new PortletWindowImpl(getId());
>@@ -151,12 +154,12 @@
> 		try {
> 			PortletContainerFactory.getPortletContainer().portletLoad(portletWindow, wrappedRequest, response);
> 		} catch (PortletContainerException e) {
>-			Log.error("Error in Portlet", e);
>+			log.error("Error in Portlet", e);
> 			errorMsg = getErrorMsg();
> 		} catch (Throwable t) {
> 			// If we catch any throwable, we want to try to continue
> 			// so that the rest of the portal renders correctly
>-			Log.error("Error in Portlet", t);
>+			log.error("Error in Portlet", t);
> 			if (t instanceof VirtualMachineError) {
> 				// if the Throwable is a VirtualMachineError then
> 				// it is very unlikely (!) that the portal is going
>@@ -198,7 +201,7 @@
> 				// render the Portlet to the wrapped response, to be output later.
> 				PortletContainerFactory.getPortletContainer().renderPortlet(portletWindow, wrappedRequest, wrappedResponse);
> 			} catch (UnavailableException e) {
>-				Log.error("Portlet is Unavailable", e);
>+				log.error("Portlet is Unavailable", e);
> 				writer2.println("the portlet is currently unavailable!");
> 
> 				ServletDefinitionCtrl servletDefinitionCtrl = (ServletDefinitionCtrl) ControllerObjectAccess.get(portletWindow.getPortletEntity().getPortletDefinition().getServletDefinition());
>@@ -212,7 +215,7 @@
> 					servletDefinitionCtrl.setAvailable(System.currentTimeMillis() + unavailableSeconds * 1000);
> 				}
> 			} catch (Exception e) {
>-				Log.error("Error in Portlet", e);
>+				log.error("Error in Portlet", e);
> 				writer2.println(getErrorMsg());
> 			}
> 			String dyn_title = ((DynamicTitleServiceImpl) FactoryAccess.getDynamicTitleContainerService()).getDynamicTitle(portletWindow, request);
>Index: portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 PreferenceSetImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java	7 Jan 2004 20:37:16 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/om/common/impl/PreferenceSetImpl.java	16 Feb 2004 04:14:15 -0000
>@@ -67,13 +67,19 @@
> import org.apache.pluto.om.common.PreferenceSet;
> import org.apache.pluto.om.common.PreferenceSetCtrl;
> import org.apache.pluto.util.StringUtils;
>-import org.apache.pluto.services.log.Log;
>+import org.apache.pluto.portalImpl.services.log.Log;
>+import org.apache.pluto.services.log.Logger;
> 
> public class PreferenceSetImpl extends HashSet
> implements PreferenceSet, PreferenceSetCtrl, java.io.Serializable {
> 
>     private String castorPreferencesValidator; 
>     private ClassLoader classLoader;
>+    private Logger log = null;
>+
>+    public PreferenceSetImpl() {
>+        this.log = Log.getService().getLogger(getClass());
>+    }
> 
>     // PreferenceSet implementation.
> 
>@@ -102,10 +108,9 @@
>             if (validator instanceof PreferencesValidator)
>                 return(PreferencesValidator)validator;
>             else
>-                Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", 
>-                          "Specified class " + castorPreferencesValidator +" is no preferences validator.");
>+                log.error("Specified class " + castorPreferencesValidator +" is no preferences validator.");
>         } catch (Exception e) {
>-            Log.error("org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl", e.getMessage(), e);
>+            log.error(e.getMessage(), e);
>         }
> 
>         return null;
>Index: portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 FragmentImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java	7 Jan 2004 20:37:20 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/om/page/impl/FragmentImpl.java	16 Feb 2004 04:14:15 -0000
>@@ -160,8 +160,7 @@
>         org.apache.pluto.portalImpl.aggregation.Fragment fragment = null;
>         if (classname == null) {
>             if (type == null) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "No type defined in pageregistry.xml");
>+                Log.error("No type defined in pageregistry.xml");
>                 return null;
>             }
>             if (type.equalsIgnoreCase("page")) {
>@@ -189,8 +188,7 @@
>                                                                                        this,
>                                                                                        nav);
>             } else {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Unknown type "+type+" defined in pageregistry.xml");
>+                Log.error("Unknown type "+type+" defined in pageregistry.xml");
>                 return null;
>             }
>         } else {
>@@ -206,12 +204,10 @@
>             try {
>                 constructor = Class.forName(classname).getConstructor(parameterClasses);
>             } catch (NoSuchMethodException e) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Invalid class or classname defined in pageregistry.xml",e);
>+                Log.error("Invalid class or classname defined in pageregistry.xml",e);
>                 return null;
>             } catch (ClassNotFoundException e) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Invalid class or classname defined in pageregistry.xml",e);
>+                Log.error("Invalid class or classname defined in pageregistry.xml",e);
>                 return null;
>             }
>             Object[] parameters = {
>@@ -224,22 +220,18 @@
>             try {
>                 Object _fragment = constructor.newInstance(parameters);
>                 if (!(_fragment instanceof org.apache.pluto.portalImpl.aggregation.Fragment)) {
>-                    Log.error("org.apache.pluto.portalImpl",
>-                              "Invalid class or classname defined in pageregistry.xml");
>+                    Log.error("Invalid class or classname defined in pageregistry.xml");
>                     return null;
>                 }
>                 fragment = (org.apache.pluto.portalImpl.aggregation.Fragment)_fragment;
>             } catch (InstantiationException e) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Invalid class or classname defined in pageregistry.xml",e);
>+                Log.error("Invalid class or classname defined in pageregistry.xml",e);
>                 return null;
>             } catch (IllegalAccessException e) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Invalid class or classname defined in pageregistry.xml",e);
>+                Log.error("Invalid class or classname defined in pageregistry.xml",e);
>                 return null;
>             } catch (InvocationTargetException e) {
>-                Log.error("org.apache.pluto.portalImpl",
>-                          "Invalid class or classname defined in pageregistry.xml",e);
>+                Log.error("Invalid class or classname defined in pageregistry.xml",e);
>                 return null;
>             }
>         }        
>Index: portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 ServletDefinitionImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java	7 Jan 2004 20:37:23 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/ServletDefinitionImpl.java	16 Feb 2004 04:14:17 -0000
>@@ -147,13 +147,11 @@
>     {
>         ServletContext newContext = webApplication.getServletContext(servletContext);
>         if (newContext==null) {
>-            Log.error("org.apache.pluto.portalImpl",
>-                      "ServletContext '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' not found!");
>+            Log.error("ServletContext '"+((WebApplicationDefinitionImpl)webApplication).getContextRoot()+"' not found!");
>             return null;
>         }
>-        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
>-            Log.debug("org.apache.pluto.portalImpl",
>-                      "Looking up RequestDispatcher for servlet mapping "+servletMapping.getUrlPattern());
>+        if (Log.isDebugEnabled()) {
>+            Log.debug("Looking up RequestDispatcher for servlet mapping "+servletMapping.getUrlPattern());
>         }
>         return newContext.getRequestDispatcher(servletMapping.getUrlPattern());
>     }
>Index: portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 WebApplicationDefinitionImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java	7 Jan 2004 20:37:23 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/om/servlet/impl/WebApplicationDefinitionImpl.java	16 Feb 2004 04:14:17 -0000
>@@ -147,9 +147,8 @@
> 
>     public ServletContext getServletContext(ServletContext servletContext)
>     {
>-        if (Log.isDebugEnabled("org.apache.pluto.portalImpl")) {
>-            Log.debug("org.apache.pluto.portalImpl",
>-                      "Looking up ServletContext for path "+contextPath);
>+        if (Log.isDebugEnabled()) {
>+            Log.debug("Looking up ServletContext for path "+contextPath);
>         }
>         return servletContext.getContext(contextPath);
>     }
>Index: portal/src/java/org/apache/pluto/portalImpl/services/Service.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/Service.java,v
>retrieving revision 1.1
>diff -u -r1.1 Service.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/Service.java	7 Jan 2004 20:37:20 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/Service.java	16 Feb 2004 04:14:17 -0000
>@@ -61,9 +61,6 @@
> import javax.servlet.ServletContext;
> 
> import org.apache.pluto.portalImpl.util.Properties;
>-import org.apache.pluto.util.StringUtils;
>-
>-import org.apache.pluto.portalImpl.services.log.*;
> 
> /**
>  ** This is the base class for all services of the system. It prototypes
>@@ -85,23 +82,11 @@
> public abstract class Service
> {
> 
>-
>-    protected final boolean IS_DEBUG_ENABLED;
>-
>     /**
>      ** Constructs the service.
>      **/
>+    protected Service () {
> 
>-    protected Service ()
>-    {
>-        if (ServiceManager.getService (LogService.class) != null)
>-        {
>-            IS_DEBUG_ENABLED = Log.isDebugEnabled (StringUtils.packageOf (getClass ()));
>-        }
>-        else
>-        {
>-            IS_DEBUG_ENABLED = true;
>-        }
>     }
> 
>     /**
>Index: portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java,v
>retrieving revision 1.1
>diff -u -r1.1 ServiceManager.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java	7 Jan 2004 20:37:20 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/ServiceManager.java	16 Feb 2004 04:14:18 -0000
>@@ -68,7 +68,7 @@
> 
> /**
>  * Manages the life-time of services registered during servlet startup.
>- * A service has to derive from {@link ContainerService} and implement the
>+ * A service has to derive from {@link org.apache.pluto.services.ContainerService} and implement the
>  * <CODE>init()</CODE> and <CODE>destroy()</CODE> methods as appropriate.
>  * 
>  * <P>
>@@ -77,7 +77,7 @@
>  * available to the portal engine. The format of the file is simple:
>  * 
>  * <PRE>
>- *   org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServicesImpl
>+ *   org.apache.pluto.portalImpl.services.log.Logger = org.apache.pluto.portalImpl.services.log.LogServicesImpl
>  * </PRE>
>  * 
>  * Each entry represents one service. The left-hand side is the abstract
>@@ -89,7 +89,8 @@
>  * <CODE>/config/services</CODE>. It has to have the name of either
>  * implementation or abstract class of the service, without the
>  * leading package name. For example, the service manager looks
>- * for <CODE>LogServiceImpl.properties</CODE>. This allows a special
>+ * for <CODE>LoggerImpl
>+.properties</CODE>. This allows a special
>  * implementation to provide different configuration than the
>  * general (abstract) service requires.
>  * 
>@@ -99,7 +100,7 @@
>  * object. Not providing a service configuration file is okay too,
>  * in that case the properties are empty.
>  * 
>- * @see ContainerService
>+ * @see org.apache.pluto.services.ContainerService
>  */
> public class ServiceManager
> {
>Index: portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java,v
>retrieving revision 1.1
>diff -u -r1.1 Log.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java	7 Jan 2004 20:37:22 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/log/Log.java	16 Feb 2004 04:14:19 -0000
>@@ -58,76 +58,80 @@
> package org.apache.pluto.portalImpl.services.log;
> 
> import org.apache.pluto.portalImpl.services.ServiceManager;
>+import org.apache.pluto.services.log.Logger;
> 
> /**
>- ** This is the static accessor for the <code>LogService</code>.
>+ ** This is the static accessor for the <code>Logger</code>.
>+ ** All log messages logged using this classes static log
>+ ** methods log to the org.apache.pluto.portalImpl category.
>  **
>- ** @see   LogService
>+ ** @see   org.apache.pluto.services.log.Logger
>  **/
> 
> public class Log
> {
> 
>+    private static Logger log =
>+        getService().getLogger("org.apache.pluto.portalImpl");
> 
>-    public static boolean isDebugEnabled (String aComponent)
>-    {
>-        return (cService.isDebugEnabled (aComponent));
>+    public static boolean isDebugEnabled() {
>+        return log.isDebugEnabled();
>     }
> 
>-    public static boolean isInfoEnabled (String aComponent)
>-    {
>-        return (cService.isInfoEnabled (aComponent));
>+    public static boolean isInfoEnabled() {
>+        return log.isInfoEnabled();
>     }
> 
>-    public static boolean isWarnEnabled (String aComponent)
>-    {
>-        return (cService.isWarnEnabled (aComponent));
>+    public static boolean isWarnEnabled() {
>+        return log.isWarnEnabled();
>     }
> 
>-    public static boolean isErrorEnabled (String aComponent)
>-    {
>-        return (cService.isErrorEnabled (aComponent));
>+    public static boolean isErrorEnabled() {
>+        return log.isErrorEnabled();
>     }
> 
>-    public static void debug (String aComponent, String aMessage)
>-    {
>-        cService.debug (aComponent, aMessage);
>+    public static void debug(String aMessage) {
>+        log.debug(aMessage);
>     }
> 
>-    public static void debug (String aComponent, String aMessage, Throwable aThrowable)
>-    {
>-        cService.debug (aComponent, aMessage, aThrowable);
>+    public static void debug(String aMessage, Throwable aThrowable) {
>+        log.debug(aMessage, aThrowable);
>     }
> 
>-    public static void info (String aComponent, String aMessage)
>-    {
>-        cService.info (aComponent, aMessage);
>+    public static void info(String aMessage) {
>+        log.info(aMessage);
>     }
> 
>-    public static void warn (String aComponent, String aMessage)
>-    {
>-        cService.warn (aComponent, aMessage);
>+    public static void warn(String aMessage) {
>+        log.warn(aMessage);
>     }
> 
>-    public static void error (String aComponent, String aMessage)
>-    {
>-        cService.error (aComponent, aMessage, null);
>+    public static void error(String aMessage) {
>+        log.error(aMessage);
>     }
> 
>-    public static void error (String aComponent, String aMessage, Throwable aThrowable)
>-    {
>-        cService.error (aComponent, aMessage, aThrowable);
>+    public static void error(String aMessage, Throwable aThrowable) {
>+        log.error(aMessage, aThrowable);
>     }
> 
>-    public static void error (String aComponent, Throwable aThrowable)
>-    {
>-        cService.error (aComponent, aThrowable);
>+    public static void error(Throwable aThrowable) {
>+        log.error(aThrowable);
>     }
> 
>-    public static LogService getService()
>-    {
>-        return cService;
>+    /** Returns the LogService which has been registered
>+     *  with the ServiceManager. If one does not yet exist,
>+     *  the StandardOutLogService (LogServiceImpl) is
>+     *  and returned.  This must take place since the
>+     *  Deployer (which does not register services) requires
>+     *  a valid log.
>+     * @return
>+     */
>+    public static LogService getService() {
>+        LogService ls = (LogService)
>+                ServiceManager.getService(LogService.class);
>+        if(ls==null)
>+            ls = StandardOutLogService.getInstance();
>+        return ls;
>     }
> 
>-    private final static LogService cService = (LogService) ServiceManager.getService (LogService.class);
> }
>Index: portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java,v
>retrieving revision 1.1
>diff -u -r1.1 LogService.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java	7 Jan 2004 20:37:22 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/log/LogService.java	16 Feb 2004 04:14:19 -0000
>@@ -59,30 +59,10 @@
> 
> import org.apache.pluto.portalImpl.services.Service;
> 
>+/** Defines the PortalDrivers LogService implementation
>+ *  for pluto.
>+ */
> public abstract class LogService extends Service
>-implements org.apache.pluto.services.log.LogService
>-{
>-
>-    // org.apache.pluto.services.log.LogService implementation.
>-    public abstract boolean isDebugEnabled (String aComponent);
>-    
>-    public abstract boolean isInfoEnabled (String aComponent);
>-    
>-    public abstract boolean isWarnEnabled (String aComponent);
>-
>-    public abstract boolean isErrorEnabled (String aComponent);
>-
>-
>-    public abstract void debug (String aComponent, String aMessage);
>-
>-    public abstract void debug (String aComponent, String aMessage, Throwable aThrowable);
>-
>-    public abstract void info (String aComponent, String aMessage);
>-
>-    public abstract void warn (String aComponent, String aMessage);
>-
>-    public abstract void error (String aComponent, String aMessage, Throwable aThrowable);
>-
>-    public abstract void error (String aComponent, Throwable aThrowable);
>+implements org.apache.pluto.services.log.LogService {
> 
> }
>Index: portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 LogServiceImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java	7 Jan 2004 20:37:22 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/log/LogServiceImpl.java	16 Feb 2004 04:14:20 -0000
>@@ -58,88 +58,35 @@
> package org.apache.pluto.portalImpl.services.log;
> 
> import org.apache.pluto.portalImpl.util.Properties;
>+import org.apache.pluto.portalImpl.services.Service;
>+import org.apache.pluto.services.log.*;
>+import org.apache.pluto.services.log.Logger;
>+import org.apache.commons.logging.LogFactory;
>+
>+/** LogService implementation which uses Commons Logging.
>+ *  The use of commons logging provides us with a simple yet
>+ *  effective way to abstract the logging implementation.  Commons
>+ *  Logging will be initialized in it's default manner according
>+ *  to: http://jakarta.apache.org/commons/logging/userguide.html.
>+ *
>+ *  If no configuraiton is found, Commons Logging will use it's
>+ *  SimpleLog configuration, which will log everything to standard
>+ *  error.
>+ */
>+public class LogServiceImpl
>+    extends LogService {
>+
>+    public Logger getLogger(String component) {
>+        return new LoggerImpl(
>+            LogFactory.getLog(component)
>+        );
> 
>-public class LogServiceImpl extends LogService
>-{
>-
>-    public void init (Properties aProperties)
>-    {
>-        iIsDebugEnabled = aProperties.getBoolean ("debug.enable", Boolean.FALSE).booleanValue ();
>-        iIsInfoEnabled  = aProperties.getBoolean ("info.enable", Boolean.FALSE).booleanValue ();
>-        iIsWarnEnabled  = aProperties.getBoolean ("warn.enable", Boolean.FALSE).booleanValue ();
>-        iIsErrorEnabled = aProperties.getBoolean ("error.enable", Boolean.FALSE).booleanValue ();
>-    }
>-
>-    public boolean isDebugEnabled (String aComponent)
>-    {
>-        return (iIsDebugEnabled);
>-    }
>-
>-    public boolean isInfoEnabled (String aComponent)
>-    {
>-        return (iIsInfoEnabled);
>-    }
>-
>-    public boolean isWarnEnabled (String aComponent)
>-    {
>-        return (iIsWarnEnabled);
>-    }
>-
>-    public boolean isErrorEnabled (String aComponent)
>-    {
>-        return (iIsErrorEnabled);
>-    }
>-
>-    public void debug (String aComponent, String aMessage)
>-    {
>-        if (iIsDebugEnabled)
>-        {
>-            System.out.println ("DEBUG  " + aComponent + "   " + aMessage);
>-        }
>-    }
>-
>-    public void debug (String aComponent, String aMessage, Throwable aThrowable)
>-    {
>-        if (iIsDebugEnabled)
>-        {
>-            System.out.println ("DEBUG  " + aComponent + "   " + aMessage);
>-        }
>-    }
>-
>-    public void info (String aComponent, String aMessage)
>-    {
>-        if (iIsInfoEnabled)
>-        {
>-            System.out.println ("INFO   " + aComponent + "   " + aMessage);
>-        }
>-    }
>-
>-    public void warn (String aComponent, String aMessage)
>-    {
>-        if (iIsWarnEnabled)
>-        {
>-            System.out.println ("WARN   " + aComponent + "   " + aMessage);
>-        }
>-    }
>-
>-    public void error (String aComponent, String aMessage, Throwable aThrowable)
>-    {
>-        if (iIsErrorEnabled)
>-        {
>-            System.out.println ("ERROR  " + aComponent + "   " + aMessage);
>-
>-            if (aThrowable != null)
>-                aThrowable.printStackTrace (System.out);
>-        }
>     }
> 
>-    public void error (String aComponent, Throwable aThrowable)
>-    {
>-        error (aComponent, "An exception has been thrown:", aThrowable);
>+    public Logger getLogger(Class klass) {
>+        return new LoggerImpl(
>+            LogFactory.getLog(klass)
>+        );
>     }
> 
>-    private boolean iIsDebugEnabled;
>-    private boolean iIsInfoEnabled;
>-    private boolean iIsWarnEnabled;
>-    private boolean iIsErrorEnabled;
> }
>Index: portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 PageRegistryServiceFileImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java	7 Jan 2004 20:37:23 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/pageregistry/PageRegistryServiceFileImpl.java	16 Feb 2004 04:14:21 -0000
>@@ -70,6 +70,7 @@
> import org.apache.pluto.portalImpl.om.page.impl.PortalImpl;
> import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.util.Properties;
>+import org.apache.pluto.services.log.Logger;
> import org.exolab.castor.mapping.Mapping;
> import org.exolab.castor.xml.Marshaller;
> import org.exolab.castor.xml.Unmarshaller;
>@@ -97,12 +98,14 @@
>     // Root element
>     private PortalImpl registry = null;
>     private RootFragment root = null;
>+    private Logger log = null;
> 
>     private HashMap fragments = new HashMap();
> 
>     public void init (ServletConfig config, Properties properties) throws Exception
>     {        
>         servletContext = config.getServletContext();
>+        log = Log.getService().getLogger(getClass());
> 
>         String _mapping = properties.getString(CONFIG_MAPPING, DEFAULT_MAPPING);
>         File f = new File(_mapping);
>@@ -116,19 +119,16 @@
>         }
>         catch (Exception e)
>         {
>-            Log.error("org.apache.pluto.portalImpl.services", 
>-                      "Failed to load mapping file "+_mapping,e);
>+            log.error("Failed to load mapping file "+_mapping,e);
>             throw e;
>         }
> 
>         load();
> 
>-        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+        if (log.isDebugEnabled())
>         {
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      "Dumping complete object model description as it is read from the xml file...");
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      registry.toString());
>+            log.debug("Dumping complete object model description as it is read from the xml file...");
>+            log.debug(registry.toString());
>         }        
>     }
> 
>@@ -136,12 +136,10 @@
>         
>         root = registry.build(config);
>              
>-        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+        if (log.isDebugEnabled())
>         {
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      "Dumping complete navigation tree created of the object model...");
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      root.getNavigation().toString());
>+            log.debug("Dumping complete navigation tree created of the object model...");
>+            log.debug(root.getNavigation().toString());
>         }
>     }
> 
>@@ -163,7 +161,7 @@
>         } else {
> 
>             String msg = "Fragment with this name "+id+" already exists in the pageregistry.xml.";
>-            Log.error("org.apache.pluto.portalImpl.services", msg);
>+            log.error(msg);
>             throw new Exception(msg);
>         }
> 
>Index: portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 PortletDefinitionRegistryServiceFileImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java	7 Jan 2004 20:37:24 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/portletdefinitionregistry/PortletDefinitionRegistryServiceFileImpl.java	16 Feb 2004 04:14:21 -0000
>@@ -77,6 +77,7 @@
> import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.util.Properties;
> import org.apache.pluto.portalImpl.xml.XmlParser;
>+import org.apache.pluto.services.log.Logger;
> import org.exolab.castor.mapping.Mapping;
> import org.exolab.castor.xml.Unmarshaller;
> import org.xml.sax.InputSource;
>@@ -106,6 +107,7 @@
>     private ServletContext servletContext = null;
>     // Base Dir where all web modules are located
>     private String baseWMDir = null;
>+    private Logger log = null;
> 
>     // Helper lists and hashtables to access the data as fast as possible
>     // List containing all portlet applications available in the system
>@@ -115,6 +117,7 @@
> 
>     public void init (ServletConfig config, Properties properties) throws Exception
>     {
>+        log = Log.getService().getLogger(getClass());
>         servletContext = config.getServletContext();
> 
>         if (properties.getBoolean("non-servlet")==Boolean.TRUE)
>@@ -123,7 +126,8 @@
>             baseWMDir = root + fileSeparator + 
> 		"WEB-INF" + fileSeparator + 
> 		"portletapps" + fileSeparator; //org.apache.pluto.portalImpl.services.deploy.DeployServiceFileImpl.DEFAULT_PROTECTED;
>-            Log.debug("org.apache.pluto.portalImpl.services.Portletregistry", "baseWMDir = " + baseWMDir + " fileSeparator = " + fileSeparator);
>+            if(log.isDebugEnabled())
>+                log.debug("baseWMDir = " + baseWMDir + " fileSeparator = " + fileSeparator);
>         }
>         else
>         {
>@@ -143,8 +147,7 @@
>         }
>         catch (Exception e)
>         {
>-            Log.error("org.apache.pluto.portalImpl.services", 
>-                      "Failed to load mapping file "+_mapping,e);
>+            log.error("Failed to load mapping file "+_mapping,e);
>             throw e;
>         }
>         // get web xml mapping file
>@@ -158,8 +161,7 @@
>         }
>         catch (Exception e)
>         {
>-            Log.error("org.apache.pluto.portalImpl.services", 
>-                      "Failed to load mapping file "+_mapping,e);
>+            log.error("Failed to load mapping file "+_mapping,e);
>             throw e;
>         }
> 
>@@ -203,10 +205,9 @@
>         // portlet application web module
>         if (portletXml.exists()) // && (webXml.exists()))
>         {
>-            if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+            if (log.isDebugEnabled())
>             {
>-                Log.debug("org.apache.pluto.portalImpl.services", 
>-                          "Loading the following Portlet Applications XML files..."+portletXml+", "+webXml);
>+                log.debug("Loading the following Portlet Applications XML files..."+portletXml+", "+webXml);
>             }
> 
>             InputSource source = new InputSource(new FileInputStream(portletXml));
>@@ -240,16 +241,16 @@
> 
>                 webApp.postBuild(structure);
> 
>-                if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+                if (log.isDebugEnabled())
>                 {
>-                    Log.debug("org.apache.pluto.portalImpl.services", webApp.toString());
>+                    log.debug(webApp.toString());
>                 }
>             }
>             else
>             {
>-                if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+                if (log.isDebugEnabled())
>                 {
>-                    Log.debug("org.apache.pluto.portalImpl.services", "no web.xml...");
>+                    log.debug("no web.xml...");
>                 }
>                 Vector structure = new Vector();
>                 structure.add("/" + webModule);
>@@ -265,19 +266,15 @@
> 
>             registry.add( portletApp );
> 
>-            if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+            if (log.isDebugEnabled())
>             {
>                 if (webApp!=null)
>                 {
>-                    Log.debug("org.apache.pluto.portalImpl.services", 
>-                              "Dumping content of web.xml...");
>-                    Log.debug("org.apache.pluto.portalImpl.services", 
>-                              webApp.toString());
>+                    log.debug("Dumping content of web.xml...");
>+                    log.debug(webApp.toString());
>                 }
>-                Log.debug("org.apache.pluto.portalImpl.services", 
>-                          "Dumping content of portlet.xml...");
>-                Log.debug("org.apache.pluto.portalImpl.services", 
>-                          portletApp.toString());
>+                log.debug("Dumping content of portlet.xml...");
>+                log.debug(portletApp.toString());
>             }
>         }
> 
>Index: portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java,v
>retrieving revision 1.1
>diff -u -r1.1 PortletEntityRegistryServiceFileImpl.java
>--- portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java	7 Jan 2004 20:37:20 -0000	1.1
>+++ portal/src/java/org/apache/pluto/portalImpl/services/portletentityregistry/PortletEntityRegistryServiceFileImpl.java	16 Feb 2004 04:14:23 -0000
>@@ -75,6 +75,7 @@
> import org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityListImpl;
> import org.apache.pluto.portalImpl.services.log.Log;
> import org.apache.pluto.portalImpl.util.Properties;
>+import org.apache.pluto.services.log.Logger;
> import org.exolab.castor.mapping.Mapping;
> import org.exolab.castor.xml.Marshaller;
> import org.exolab.castor.xml.Unmarshaller;
>@@ -99,6 +100,7 @@
>     protected Mapping mapping = null;
>     // Servlet Context
>     protected ServletContext servletContext = null;
>+    private Logger log = null;
>     // Registry
>     protected PortletApplicationEntityListImpl registry = null;
>     
>@@ -108,6 +110,7 @@
>     public void init (ServletConfig servletConfig, Properties properties) throws Exception
>     {
>         servletContext = servletConfig.getServletContext();
>+        log = Log.getService().getLogger(getClass());
> 
>         String _mapping = properties.getString(CONFIG_MAPPING, DEFAULT_MAPPING);
>         File f = new File(_mapping);
>@@ -121,7 +124,7 @@
>         }
>         catch (Exception e)
>         {
>-            Log.error("Failed to load mapping file "+_mapping,e);
>+            log.error("Failed to load mapping file "+_mapping,e);
>             throw e;
>         }
>     
>@@ -185,12 +188,10 @@
>     {
>         _load();
> 
>-        if (Log.isDebugEnabled("org.apache.pluto.portalImpl.services"))
>+        if (log.isDebugEnabled())
>         {
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      "Dumping complete object model description as it is read from the xml file...");
>-            Log.debug("org.apache.pluto.portalImpl.services", 
>-                      registry.toString());
>+            log.debug("Dumping complete object model description as it is read from the xml file...");
>+            log.debug(registry.toString());
>         }
> 
>         fill();
>Index: portal/src/webapp/WEB-INF/config/services.properties
>===================================================================
>RCS file: /home/cvspublic/jakarta-pluto/portal/src/webapp/WEB-INF/config/services.properties,v
>retrieving revision 1.1
>diff -u -r1.1 services.properties
>--- portal/src/webapp/WEB-INF/config/services.properties	7 Jan 2004 20:37:19 -0000	1.1
>+++ portal/src/webapp/WEB-INF/config/services.properties	16 Feb 2004 04:14:23 -0000
>@@ -4,9 +4,8 @@
> 
> org.apache.pluto.portalImpl.services.config.ConfigService = org.apache.pluto.portalImpl.services.config.ConfigServiceImpl
> 
>-# LogServiceImpl writes to System.out. LogServiceCommonsLoggingImpl uses commons-logging
>-#org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServiceImpl
>-org.apache.pluto.portalImpl.services.log.LogService = org.apache.pluto.portalImpl.services.log.LogServiceCommonsLoggingImpl
>+org.apache.pluto.portalImpl.services.log.LogService= org.apache.pluto.portalImpl.services.log.LogServiceImpl
>+
> 
> org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerService = org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerServiceImpl
> 
>  
>