[prev in list] [next in list] [prev in thread] [next in thread]
List: jetspeed-dev
Subject: cvs commit: jakarta-jetspeed/xdocs changes.xml
From: morciuch () apache ! org
Date: 2002-12-23 23:14:51
[Download RAW message or body]
morciuch 2002/12/23 15:14:49
Modified: docs/site changes.html
xdocs changes.xml
Added: src/java/org/apache/jetspeed/services/logging
BaseLogger.java JetspeedLoggingService.java
webapp/WEB-INF/conf log4j.properties
Log:
Added replacement for Turbine Logging service which is based on log4j via commons \
logging. To activate:
1. Add init-param "logging" in web.xml and set it to \
"org.apache.jetspeed.services.logging.JetspeedLoggingService". 2. Change this in \
tr.props: services.LoggingService.classname = \
org.apache.jetspeed.services.logging.JetspeedLoggingService \
services.LoggingService.default = jetspeed 3. Add this in tr.props:
services.LoggingService.log4j.properties = /WEB-INF/conf/log4j.properties
No source code changes are necessary since all logging is done via \
org.apache.turbine.util.Log. This class will be deprecated in Turbine 2.3 so we'll \
have to change references to it globally.
Revision Changes Path
1.87 +3 -0 jakarta-jetspeed/docs/site/changes.html
Index: changes.html
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/docs/site/changes.html,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- changes.html 22 Dec 2002 21:25:13 -0000 1.86
+++ changes.html 23 Dec 2002 23:14:48 -0000 1.87
@@ -133,6 +133,9 @@
</li>
-->
<li>
+ Add - Bug # 15214 - 2002/12/23 - Added commons logging based replacement for \
Turbine Logging Service (MO) +</li>
+<li>
Fixed - Bug # 15595 - 2002/12/22 - Fixed problem with logging portlet access \
(MO) </li>
<li>
1.1 \
jakarta-jetspeed/src/java/org/apache/jetspeed/services/logging/BaseLogger.java
Index: BaseLogger.java
===================================================================
package org.apache.jetspeed.services.logging;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 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 acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Turbine" 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",
* "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* 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/>.
*/
// Turbine classes
import org.apache.turbine.util.RunData;
import org.apache.turbine.services.logging.Logger;
import org.apache.turbine.services.logging.LoggingConfig;
// commons logging classes
import org.apache.commons.logging.Log;
/**
* Classes that implement the Logger interface allows loging.
* There is set of standart printing methods (info, debug ...).
* This is a wrapper for the commons Log object.
*
* @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
* @version $Id: BaseLogger.java,v 1.1 2002/12/23 23:14:49 morciuch Exp $
*/
public class BaseLogger implements Logger
{
/**
* Reference to commons logger
*/
private Log log = null;
/**
* Current log level for logger
*/
private int logLevel;
/**
* Name of the logger
*/
private String name;
/**
* Parametrized constructor
*
* @param log
*/
public BaseLogger(Log log)
{
this.log = log;
}
/**
* name of the logger
*
* @return log name
*/
public String getName()
{
return this.name;
}
/**
* Setings the name
*
* @param logName
*/
public void setName(String logName)
{
this.name = logName;
}
/**
* Reference to commons log
*
* @return commons log
*/
public Log getLog()
{
return this.log;
}
/**
* Sets reference to commons log
*
* @param log
*/
public void setLog(Log log)
{
this.log = log;
}
/**
* This method should be implemented by user.
* It performs action that are need for deterimne whether
* logger was well configured or has any output
*
* @return true if logger is well configured
*/
public boolean checkLogger()
{
return true;
}
/**
* This method sets parameters for the logger implementation.
* If the implementation cannot handle some type of destination should ignore
* that output.
*
* @param LoggingConfig configuration object for logging
*/
public void init(LoggingConfig loggingConfig)
{
// Nothing to do. Declared to satisfy the interface.
}
/**
* Close all destinations
*/
public void shutdown()
{
// nothing to do
}
/**
* Sets log level for the logger
*
* @param level
*/
public void setLogLevel(int level)
{
this.logLevel = level;
}
/**
* Checks if DEBUG statements are enabled.
*
* @return true if debug is enabled
*/
public boolean isDebugEnabled()
{
return this.log.isDebugEnabled();
}
/**
* Checks if INFO statements are enabled.
*
* @return true if into is enabled
*/
public boolean isInfoEnabled()
{
return this.log.isInfoEnabled();
}
/**
* Checks if WARN statements are enabled.
*
* @return true if warn is enabled
*/
public boolean isWarnEnabled()
{
return this.log.isWarnEnabled();
}
/**
* Checks if ERROR statements are enabled.
*
* @return true if error is enabled
*/
public boolean isErrorEnabled()
{
return this.log.isErrorEnabled();
}
/**
* Sets format style for extracting data from RunData
*
* @param format
*/
public void setFormat(String format)
{
// nothing to do
}
/**
* This is a log method with logLevel == DEBUG
*
* @param message
*/
public void debug(String message)
{
this.log.debug(message);
}
/**
* This is a log method with logLevel == DEBUG
*
* @param message
* @param t
*/
public void debug(String message, Throwable t)
{
this.log.debug(message, t);
}
/**
* This is a log method with logLevel == DEBUG
*
* @param message
* @param data
*/
public void debug(String message, RunData data)
{
this.log.debug(message);
}
/**
* This is a log method with logLevel == DEBUG
*
* @param message
* @param data
* @param t
*/
public void debug(String message, RunData data, Throwable t)
{
this.log.debug(message, t);
}
/**
* This is a log method with logLevel == INFO
*
* @param message
*/
public void info(String message)
{
this.log.info(message);
}
/**
* This is a log method with logLevel == INFO
*
* @param message
* @param t
*/
public void info(String message, Throwable t)
{
this.log.info(message, t);
}
/**
* This is a log method with logLevel == INFO
*
* @param message
* @param data
*/
public void info(String message, RunData data)
{
this.log.info(message);
}
/**
* This is a log method with logLevel == INFO
*
* @param message
* @param data
* @param t
*/
public void info(String message, RunData data, Throwable t)
{
this.log.info(message, t);
}
/**
* This is a log method with logLevel == WARN
*
* @param message
*/
public void warn(String message)
{
this.log.warn(message);
}
/**
* This is a log method with logLevel == WARN
*
* @param message
* @param t
*/
public void warn(String message, Throwable t)
{
this.log.warn(message, t);
}
/**
* This is a log method with logLevel == WARN
*
* @param message
* @param data
*/
public void warn(String message, RunData data)
{
this.log.warn(message);
}
/**
* This is a log method with logLevel == WARN
*
* @param message
* @param data
* @param t
*/
public void warn(String message, RunData data, Throwable t)
{
this.log.warn(message, t);
}
/**
* This is a log method with logLevel == ERROR
*
* @param message
*/
public void error(String message)
{
this.log.error(message);
}
/**
* This is a log method with logLevel == ERROR
*
* @param message
* @param e
*/
public void error(String message, Throwable e)
{
this.log.error(message, e);
}
/**
* This is a log method with logLevel == ERROR
*
* @param e
*/
public void error(Throwable e)
{
this.log.error(e);
}
/**
* This is a log method with logLevel == ERROR
*
* @param message
* @param data
*/
public void error(String message, RunData data)
{
this.log.error(message);
}
/**
* This is a log method with logLevel == ERROR
*
* @param message
* @param data
* @param e
*/
public void error(String message, RunData data, Throwable e)
{
this.log.error(message, e);
}
}
1.1 \
jakarta-jetspeed/src/java/org/apache/jetspeed/services/logging/JetspeedLoggingService.java
Index: JetspeedLoggingService.java
===================================================================
package org.apache.jetspeed.services.logging;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 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 acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Turbine" 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",
* "Apache Turbine", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* 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/>.
*/
// Java classes
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
import java.io.FileInputStream;
// Servlet API
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
// Turbine classes
import org.apache.turbine.services.InitializationException;
import org.apache.turbine.services.TurbineBaseService;
import org.apache.turbine.services.TurbineServices;
import org.apache.turbine.services.resources.ResourceService;
import org.apache.turbine.services.resources.TurbineResources;
import org.apache.turbine.services.logging.LoggingService;
import org.apache.turbine.services.logging.LoggingConfig;
import org.apache.turbine.services.logging.Logger;
import org.apache.turbine.util.RunData;
import org.apache.turbine.Turbine;
// commons logging classes
import org.apache.commons.logging.LogFactory;
// log4j stuff
import org.apache.log4j.PropertyConfigurator;
/**
* The default implementation of the logging service in Jetspeed.
*
* This service functions as a logger provider.
* It allows access to loggers: explicit by the getLogger method,
* or by printing methods (info, error...).
* Real work is done by classes that implement interface: Logger.
* The configuration of the service is read from the TurbineResources.properties.
* The rest of the configuration is done through a defined LoggingConfig class.
*
* Names of the loggers, classes, log levels, destinations are defined in that \
file.
*
* @see org.apache.turbine.services.logging.Logger
* @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
* @version $Id: JetspeedLoggingService.java,v 1.1 2002/12/23 23:14:49 morciuch Exp \
$
*/
public class JetspeedLoggingService
extends TurbineBaseService
implements LoggingService
{
// configuration keys
private static final String CONFIG_LOG4J_PROPERTIES = "log4j.properties";
private static final String CONFIG_LOG4J_PROPERTIES_DEFAULT = \
"/WEB-INF/conf/log4j.properties";
/**
* loggers repository
*/
private Hashtable loggersTable;
/**
* logger for methods without target
*/
private Logger defaultLogger;
/**
* bootstrap and shutdown logger using context.log
*/
private Logger simpleLogger;
/**
* context for resolving paths and servlet logging
*/
private ServletContext context = null;
/**
* Resources for this Service
*/
private ResourceService resources = null;
public JetspeedLoggingService()
{
loggersTable = new Hashtable();
defaultLogger = null;
}
/**
* Load all configured components and initialize them. This is
* a zero parameter variant which queries the Turbine Servlet
* for its config.
*
* @throws InitializationException Something went wrong in the init
* stage
*/
public void init()
throws InitializationException
{
ServletConfig conf = Turbine.getTurbineServletConfig();
init(conf);
}
/**
* Inits the service using servlet parameters to obtain path to the
* configuration file. Change relatives paths.
*
* @param config The ServletConfiguration from Turbine
*
* @throws InitializationException Something went wrong when starting up.
*/
public void init(ServletConfig config)
throws InitializationException
{
context = config.getServletContext();
// Create bootstrap logger, for handling exceptions during service
// initialization.
defaultLogger = new BaseLogger(LogFactory.getLog("default"));
simpleLogger = defaultLogger;
internalInit();
setInit(true);
}
/**
* This gets the ResourceService associated to this Service
*/
public ResourceService getResources()
{
if (resources == null)
{
// Get the properties for this Service
resources = TurbineResources
.getResources(TurbineServices.SERVICE_PREFIX
+ LoggingService.SERVICE_NAME);
//add webappRoot manually - cos logging is a primary
//service and so it is not yet defined
String webappRoot = context.getRealPath("/");
resources.setProperty(Turbine.WEBAPP_ROOT, webappRoot);
}
return (resources);
}
/**
* This method initializes the service.
*/
private void internalInit() throws InitializationException
{
ResourceService props = getResources();
if (props == null)
{
throw new InitializationException("LoggingService failed to "
+ "get access to the properties for \
this service."); }
//looking for default logger name
String defaultLoggerName = props.getString(LoggingConfig.DEFAULT);
//checking whether default logger is properly configured
if (defaultLoggerName == null)
{
throw new InitializationException("LoggingService can't find "
+ "default logger name in the \
configuration file."); }
// Configure log4j logging
String log4jProperties = props.getString(this.CONFIG_LOG4J_PROPERTIES, \
this.CONFIG_LOG4J_PROPERTIES_DEFAULT); if (log4jProperties != null)
{
configureLog4J(log4jProperties);
}
// Create default logger
defaultLogger = new BaseLogger(LogFactory.getLog(defaultLoggerName));
loggersTable.put(defaultLoggerName, defaultLogger);
//checking whether default logger is properly configured
if (defaultLogger == null)
{
throw new InitializationException("LoggingService can't find "
+ "default logger in working \
loggers."); }
}
private void configureLog4J(String log4jProperties) throws \
InitializationException {
try
{
Properties p = new Properties();
p.load(new FileInputStream(Turbine.getRealPath(log4jProperties)));
p.setProperty("webappRoot", this.context.getRealPath("/"));
PropertyConfigurator.configure(p);
}
catch (Exception e)
{
throw new InitializationException("Failed to load " + log4jProperties + \
" - " + e.toString()); }
}
/**
* Shutdowns all loggers. After shutdown servlet logger is still available
* using the servlet log method
*/
public void shutdown()
{
if (!getInit())
{
return;
}
Enumeration iter = loggersTable.elements();
while (iter.hasMoreElements())
{
((Logger) iter.nextElement()).shutdown();
}
//HACK!!!!!
//some services may log using our services after shutdown
loggersTable.clear();
defaultLogger = simpleLogger;
//we don't set init as false, because we can still log.
}
/**
* This method returns default logger for Turbine System
*/
public final Logger getLogger()
{
return defaultLogger;
}
/**
* This method returns logger with given name.
*/
public Logger getLogger(String logName)
{
Logger logger = (Logger) loggersTable.get(logName);
if (logger == null)
{
logger = new BaseLogger(LogFactory.getLog(logName));
if (logger == null)
{
return defaultLogger;
}
loggersTable.put(logName, logger);
}
return logger;
}
/**
* This method sets the log level of the default logger.
*/
public void setLogLevel(int level)
{
defaultLogger.setLogLevel(level);
}
/**
* This method sets the log level of the logger of given name.
*/
public void setLogLevel(String logName, int level)
{
Logger logger = (Logger) loggersTable.get(logName);
if (logger != null)
{
logger.setLogLevel(level);
}
}
/**
* This method sets format style of the default logger
*/
public void setFormat(String format)
{
defaultLogger.setFormat(format);
}
/**
* This method sets format style of the given logger.
*/
public void setFormat(String logName, String format)
{
Logger logger = (Logger) loggersTable.get(logName);
if (logger != null)
{
logger.setFormat(format);
}
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the default logger
*/
public void debug(String message)
{
defaultLogger.debug(message);
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the default logger
*/
public void debug(String message, Throwable t)
{
defaultLogger.debug(message, t);
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the given logger
*/
public void debug(String logName, String message, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.debug(message, t);
}
else
{
defaultLogger.debug("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the given logger
*/
public void debug(String logName, String message)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.debug(message);
}
else
{
defaultLogger.debug("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the default logger
*/
public void debug(String message, RunData data)
{
defaultLogger.debug(message);
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the default logger
*/
public void debug(String message, RunData data, Throwable t)
{
defaultLogger.debug(message, t);
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the given logger
*/
public void debug(String logName, String message, RunData data, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.debug(message, data, t);
}
else
{
defaultLogger.debug("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == DEBUG, printing is done by
* the given logger
*/
public void debug(String logName, String message, RunData data)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.debug(message, data);
}
else
{
defaultLogger.debug("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the default logger
*/
public void info(String message)
{
defaultLogger.info(message);
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the default logger
*/
public void info(String message, Throwable t)
{
defaultLogger.info(message, t);
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the given logger
*/
public void info(String logName, String message)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.info(message);
}
else
{
defaultLogger.info("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the given logger
*/
public void info(String logName, String message, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.info(message, t);
}
else
{
defaultLogger.info("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the default logger
*/
public void info(String message, RunData data)
{
defaultLogger.info(message);
}
/**
* This is a log method with logLevel == INFO,printing is done by
* the default logger
*/
public void info(String message, RunData data, Throwable t)
{
defaultLogger.info(message, t);
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the given logger
*/
public void info(String logName, String message, RunData data)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.info(message, data);
}
else
{
defaultLogger.info("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == INFO, printing is done by
* the given logger
*/
public void info(String logName, String message, RunData data, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.info(message, data, t);
}
else
{
defaultLogger.info("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the default logger
*/
public void warn(String message)
{
defaultLogger.warn(message);
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the default logger
*/
public void warn(String message, Throwable t)
{
defaultLogger.warn(message, t);
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the given logger
*/
public void warn(String logName, String message)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.warn(message);
}
else
{
defaultLogger.warn("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the given logger
*/
public void warn(String logName, String message, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.warn(message, t);
}
else
{
defaultLogger.warn("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == WARN,printing is done by
* the default logger
*/
public void warn(String message, RunData data)
{
defaultLogger.warn(message);
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the default logger
*/
public void warn(String message, RunData data, Throwable t)
{
defaultLogger.warn(message, t);
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the given logger
*/
public void warn(String logName, String message, RunData data)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.warn(message, data);
}
else
{
defaultLogger.warn("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == WARN, printing is done by
* the given logger
*/
public void warn(String logName, String message, RunData data, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.warn(message, data, t);
}
else
{
defaultLogger.warn("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the default logger
*/
public void error(String message)
{
defaultLogger.error(message);
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the default logger
*/
public void error(String message, Throwable t)
{
defaultLogger.error(message, t);
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the given logger
*/
public void error(String logName, String message)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.error(message);
}
else
{
defaultLogger.error("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the given logger
*/
public void error(String logName, String message, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.error(message, t);
}
else
{
defaultLogger.error("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the default logger
*/
public void error(String message, RunData data)
{
defaultLogger.error(message);
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the default logger
*/
public void error(String message, RunData data, Throwable t)
{
defaultLogger.error(message, t);
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the given logger
*/
public void error(String logName, String message, RunData data)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.error(message, data);
}
else
{
defaultLogger.error("FROM logger:" + logName + ": " + message);
}
}
/**
* This is a log method with logLevel == ERROR, printing is done by
* the given logger
*/
public void error(String logName, String message, RunData data, Throwable t)
{
Logger logger = getLogger(logName);
if (logger != null)
{
logger.error(message, data, t);
}
else
{
defaultLogger.error("FROM logger:" + logName + ": " + message);
}
}
}
1.1 jakarta-jetspeed/webapp/WEB-INF/conf/log4j.properties
Index: log4j.properties
===================================================================
# -------------------------------------------------------------------
# $Id: log4j.properties,v 1.1 2002/12/23 23:14:49 morciuch Exp $
#
# This file contains log4j-specifc logging properties. This file is
# loaded by the logging service based on the following property:
#
# services.LoggingService.log4j.properties = \
${webappRoot}/WEB-INF/conf/log4j.properties #
# Appender specified in log4j.category.default must be the same as
# the one specified in services.LoggingService.default property.
#
# All log4j properties should be supported. Check log4j documentation
# for more information.
#
# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------
#
# If we don't know the logging facility, put it into the
# jetspeed.log. Add "stdout" to the list for console logging.
#
log4j.rootLogger = INFO, jetspeed
#
# Jetspeed goes into Jetspeed Log
#
log4j.category.org.apache.jetspeed = DEBUG, jetspeed
log4j.additivity.org.apache.jetspeed = false
#
# Turbine goes into Turbine Log
#
log4j.category.org.apache.turbine = INFO, turbine
log4j.additivity.org.apache.turbine = false
#
# Torque has its own log file
#
log4j.category.org.apache.torque = INFO, torque
log4j.additivity.org.apache.torque = false
#
# Velocity Logfile
#
log4j.category.velocity = INFO, velocity
log4j.additivity.velocity = false
#
# Portlet access Category
#
log4j.category.access = INFO, access
log4j.additivity.access = false
#
# Console output Category
#
log4j.category.stdout = INFO, stdout
log4j.additivity.stdout = false
########################################################################
#
# Logfile definitions
#
########################################################################
#
# jetspeed.log
#
log4j.appender.jetspeed = org.apache.log4j.FileAppender
log4j.appender.jetspeed.file = ${webappRoot}/WEB-INF/log/jetspeed.log
log4j.appender.jetspeed.layout = org.apache.log4j.PatternLayout
log4j.appender.jetspeed.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.jetspeed.append = false
#log4j.appender.jetspeed = org.apache.log4j.RollingFileAppender
#log4j.appender.jetspeed.file = ${webappRoot}/WEB-INF/log/rotation.log
#log4j.appender.jetspeed.MaxFileSize = 50KB
#log4j.appender.jetspeed.MaxBackupIndex = 5
#log4j.appender.jetspeed.layout = org.apache.log4j.PatternLayout
#log4j.appender.jetspeed.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] \
- %m%n
#
# turbine.log
#
log4j.appender.turbine = org.apache.log4j.FileAppender
log4j.appender.turbine.file = ${webappRoot}/WEB-INF/log/turbine.log
log4j.appender.turbine.layout = org.apache.log4j.PatternLayout
log4j.appender.turbine.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.turbine.append = false
#
# torque.log
#
log4j.appender.torque = org.apache.log4j.FileAppender
log4j.appender.torque.file = ${webappRoot}/WEB-INF/log/torque.log
log4j.appender.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.torque.append = false
#
# Portlet access Output
#
log4j.appender.access = org.apache.log4j.FileAppender
log4j.appender.access.file = ${webappRoot}/WEB-INF/log/access.log
log4j.appender.access.layout = org.apache.log4j.PatternLayout
log4j.appender.access.layout.conversionPattern = %m%n
log4j.appender.access.append = true
#
# Velocity gets configured to write its output onto the velocity
# category.
#
log4j.appender.velocity = org.apache.log4j.FileAppender
log4j.appender.velocity.file = ${webappRoot}/WEB-INF/log/velocity.log
log4j.appender.velocity.layout = org.apache.log4j.PatternLayout
log4j.appender.velocity.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.velocity.append = false
#
# Console Output
#
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss} %5p] - \
%m%n
1.105 +4 -1 jakarta-jetspeed/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- changes.xml 22 Dec 2002 21:25:13 -0000 1.104
+++ changes.xml 23 Dec 2002 23:14:49 -0000 1.105
@@ -23,6 +23,9 @@
</li>
-->
<li>
+ Add - Bug # 15214 - 2002/12/23 - Added commons logging based replacement for \
Turbine Logging Service (MO) +</li>
+<li>
Fixed - Bug # 15595 - 2002/12/22 - Fixed problem with logging portlet access \
(MO) </li>
<li>
--
To unsubscribe, e-mail: <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic