cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r439784 - in /cocoon/trunk/core: cocoon-core/src/main/java/org/apache/cocoon/configuration/ cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/ cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ cocoon-core/src/m...
Date Sun, 03 Sep 2006 14:40:21 GMT
Author: cziegeler
Date: Sun Sep  3 07:40:20 2006
New Revision: 439784

URL: http://svn.apache.org/viewvc?rev=439784&view=rev
Log:
Clean up logging configuration
Move avalon related stuff into avalon package

Added:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ClassLoaderUtils.java
      - copied, changed from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ClassLoaderUtils.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationBuilder.java
      - copied, changed from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SettingsContext.java
      - copied, changed from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
Removed:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ClassLoaderUtils.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/log4j.xconf
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/dev/core.properties
    cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/prod/core.properties

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/Settings.java
Sun Sep  3 07:40:20 2006
@@ -35,13 +35,6 @@
     String PROPERTY_RUNNING_MODE = "org.apache.cocoon.mode";
 
     /**
-     * This parameter indicates the log level to use throughout startup of the
-     * system. As soon as the logging system is setup the setting of the log4j.xconf
-     * configuration is used instead! Only for startup this log level is of importance.
-     */
-    String KEY_LOGGING_BOOTSTRAP_LOGLEVEL = "org.apache.cocoon.logging.bootstrap.loglevel";
-
-    /**
      * This parameter is used to list classes that should be loaded at
      * initialization time of the servlet. For example, JDBC Drivers used need to
      * be named here. Additional entries may be inserted here during build
@@ -50,21 +43,6 @@
     String KEY_LOAD_CLASSES = "org.apache.cocoon.classloader.load.classes";
 
     /**
-     * This parameter indicates the category id of the logger from the LogKit
-     * configuration used by the environment.
-     */
-    String KEY_LOGGING_ENVIRONMENT_LOGGER = "org.apache.cocoon.logging.category.environment";
-
-    /**
-     * This parameter indicates the category id of the logger from the LogKit
-     * management configuration for the Cocoon engine.
-     * This logger is used for all components described in the cocoon.xconf
-     * and sitemap.xmap file not having specified a logger with the
-     * logger="..." attribute in the component configuration file.
-     */
-    String KEY_LOGGING_COCOON_LOGGER = "org.apache.cocoon.logging.category.cocoon";
-
-    /**
      * This parameter allows to specify where Cocoon should put uploaded files.
      * The path specified can be either absolute or relative to the context
      * path of the servlet. On windows platform, absolute directory must start
@@ -110,13 +88,6 @@
     String KEY_CONTAINER_ENCODING = "org.apache.cocoon.containerencoding";
 
     /**
-     * If this value is specified, it will be interpreted as a log level and
-     * all logging categories will be set to this level regardless of their
-     * definition in the logging configuration.
-     */
-    String KEY_LOGGING_OVERRIDE_LOGLEVEL = "org.apache.cocoon.override.loglevel";
-
-    /**
      * Allow reinstantiating (reloading) of the cocoon instance. If this is
      * set to "yes" or "true", a new cocoon instance can be created using
      * the request parameter "cocoon-reload". It also enables that Cocoon is
@@ -206,12 +177,6 @@
     List getLoadClasses();
 
     /**
-     * @return Returns the logLevel.
-     * @see #KEY_LOGGING_BOOTSTRAP_LOGLEVEL
-     */
-    String getBootstrapLogLevel();
-
-    /**
      * @return Returns the uploadDirectory.
      * @see #KEY_UPLOADS_DIRECTORY
      */
@@ -224,18 +189,6 @@
     String getWorkDirectory();
 
     /**
-     * @return Returns the logger for the environment.
-     * @see #KEY_LOGGING_ENVIRONMENT_LOGGER
-     */
-    String getEnvironmentLogger();
-
-    /**
-     * @return Returns the overrideLogLevel.
-     * @see #KEY_LOGGING_OVERRIDE_LOGLEVEL
-     */
-    String getOverrideLogLevel();
-
-    /**
      * @return Returns the formEncoding.
      * @see #KEY_FORM_ENCODING
      */
@@ -258,12 +211,6 @@
      * @see #KEY_CACHE_DIRECTORY
      */
     String getCacheDirectory();
-
-    /**
-     * @return Returns the cocoonLogger.
-     * @see #KEY_LOGGING_COCOON_LOGGER
-     */
-    String getCocoonLogger();
 
     /**
      * The creation time of the current Cocoon instance.

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/configuration/impl/MutableSettings.java
Sun Sep  3 07:40:20 2006
@@ -44,26 +44,6 @@
     protected final Properties properties = new Properties();
 
     /**
-     * This parameter indicates the category id of the logger from the LogKit
-     * configuration used by the environment.
-     */
-    protected String environmentLogger;
-
-    /**
-     * This parameter indicates the category id of the logger from the LogKit
-     * management configuration for the Cocoon engine.
-     * This logger is used for all components described in the cocoon.xconf
-     * and sitemap.xmap file not having specified a logger with the
-     * logger="..." attribute in the component configuration file.
-     */
-    protected String cocoonLogger;
-
-    /**
-     * @see #setBootstrapLogLevel(String)
-     */
-    protected String bootstrapLogLevel;
-
-    /**
      * Allow reinstantiating (reloading) of the cocoon instance. If this is
      * set to "yes" or "true", a new cocoon instance can be created using
      * the request parameter "cocoon-reload". It also enables that Cocoon is
@@ -156,13 +136,6 @@
     protected String formEncoding;
 
     /**
-     * If this value is specified, it will be interpreted as a log level and
-     * all logging categories will be set to this level regardless of their
-     * definition in the logging configuration.
-     */
-    protected String overrideLogLevel;
-
-    /**
      * Delay between reload checks for the configuration.
      */
     protected long configurationReloadDelay;
@@ -219,12 +192,6 @@
 
                     if ( key.equals(KEY_RELOAD_DELAY) ) {
                         this.setConfigurationReloadDelay(Long.valueOf(value).longValue());
-                    } else if ( key.equals(KEY_LOGGING_ENVIRONMENT_LOGGER) ) {
-                        this.setEnvironmentLogger(value);
-                    } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
-                        this.setCocoonLogger(value);
-                    } else if ( key.equals(KEY_LOGGING_BOOTSTRAP_LOGLEVEL) ) {
-                        this.setBootstrapLogLevel(value);
                     } else if ( key.equals(KEY_RELOADING) ) {
                         this.setReloadingEnabled(BooleanUtils.toBoolean(value));
                     } else if ( key.equals(KEY_UPLOADS_ENABLE) ) {
@@ -251,8 +218,6 @@
                         this.setManageExceptions(BooleanUtils.toBoolean(value));
                     } else if ( key.equals(KEY_FORM_ENCODING) ) {
                         this.setFormEncoding(value);
-                    } else if ( key.equals(KEY_LOGGING_OVERRIDE_LOGLEVEL) ) {
-                        this.setOverrideLogLevel(value);
                     } else if ( key.startsWith(KEY_LOAD_CLASSES) ) {
                         this.addToLoadClasses(value);
                     } else if ( key.startsWith(KEY_CONTAINER_ENCODING ) ) {
@@ -315,16 +280,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.core.BaseSettings#getCocoonLogger()
-     */
-    public String getCocoonLogger() {
-        if ( this.parent != null ) {
-            return this.parent.getCocoonLogger();
-        }
-        return this.cocoonLogger;
-    }
-
-    /**
      * @see org.apache.cocoon.core.DynamicSettings#isEnableUploads()
      */
     public boolean isEnableUploads() {
@@ -373,16 +328,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.core.BaseSettings#getBootstrapLogLevel()
-     */
-    public String getBootstrapLogLevel() {
-        if ( this.parent != null ) {
-            return this.parent.getBootstrapLogLevel();
-        }
-        return this.bootstrapLogLevel;
-    }
-
-    /**
      * @see org.apache.cocoon.core.BaseSettings#isManageExceptions()
      */
     public boolean isManageExceptions() {
@@ -453,26 +398,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.core.BaseSettings#getEnvironmentLogger()
-     */
-    public String getEnvironmentLogger() {
-        if ( this.parent != null ) {
-            return this.parent.getEnvironmentLogger();
-        }
-        return this.environmentLogger;
-    }
-
-    /**
-     * @see org.apache.cocoon.core.BaseSettings#getOverrideLogLevel()
-     */
-    public String getOverrideLogLevel() {
-        if ( this.parent != null ) {
-            return this.parent.getOverrideLogLevel();
-        }
-        return this.overrideLogLevel;
-    }
-
-    /**
      * @see org.apache.cocoon.core.DynamicSettings#isAllowOverwrite()
      */
     public boolean isAllowOverwrite() {
@@ -540,12 +465,6 @@
         if ( key.startsWith(KEYPREFIX) ) {
             if ( key.equals(KEY_RELOAD_DELAY) ) {
                 value = String.valueOf(this.getReloadDelay(null));
-            } else if ( key.equals(KEY_LOGGING_ENVIRONMENT_LOGGER) ) {
-                value = this.getEnvironmentLogger();
-            } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
-                value = this.getCocoonLogger();
-            } else if ( key.equals(KEY_LOGGING_BOOTSTRAP_LOGLEVEL) ) {
-                value = this.getBootstrapLogLevel();
             } else if ( key.equals(KEY_RELOADING) ) {
                 value = String.valueOf(this.isReloadingEnabled(null));
             } else if ( key.equals(KEY_UPLOADS_ENABLE) ) {
@@ -570,8 +489,6 @@
                 value = String.valueOf(this.isManageExceptions());
             } else if ( key.equals(KEY_FORM_ENCODING) ) {
                 value = this.getFormEncoding();
-            } else if ( key.equals(KEY_LOGGING_OVERRIDE_LOGLEVEL) ) {
-                value = this.getOverrideLogLevel();
             } else if ( key.equals(KEY_LOAD_CLASSES) ) {
                 value = this.toString(this.getLoadClasses());
             } else if ( key.equals(KEY_CONTAINER_ENCODING) ) {
@@ -600,10 +517,6 @@
           KEY_RELOAD_DELAY + " : " + this.getReloadDelay(null) + '\n' +
           KEY_RELOADING + " : " + this.isReloadingEnabled(null) + '\n' +
           KEY_LOAD_CLASSES + " : " + this.toString(this.getLoadClasses()) + '\n' +
-          KEY_LOGGING_ENVIRONMENT_LOGGER + " : " + this.getEnvironmentLogger() + '\n' +
-          KEY_LOGGING_BOOTSTRAP_LOGLEVEL + " : " + this.getBootstrapLogLevel() + '\n' +
-          KEY_LOGGING_COCOON_LOGGER + " : " + this.getCocoonLogger() + '\n' +
-          KEY_LOGGING_OVERRIDE_LOGLEVEL + " : " + this.getOverrideLogLevel() + '\n' +
           KEY_MANAGE_EXCEPTIONS + " : " + this.isManageExceptions() + '\n' +
           KEY_UPLOADS_DIRECTORY + " : " + this.getUploadDirectory() + '\n' +
           KEY_UPLOADS_AUTOSAVE + " : " + this.isAutosaveUploads() + '\n' +
@@ -674,15 +587,6 @@
     }
 
     /**
-     * @param cocoonLogger The cocoonLogger to set.
-     */
-    public void setCocoonLogger(String cocoonLogger) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.cocoonLogger = cocoonLogger;
-    }
-
-    /**
      * @param enableUploads The enableUploads to set.
      */
     public void setEnableUploads(boolean enableUploads) {
@@ -709,15 +613,6 @@
     }
 
     /**
-     * @param logLevel The logLevel to set.
-     */
-    public void setBootstrapLogLevel(String logLevel) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.bootstrapLogLevel = logLevel;
-    }
-
-    /**
      * @param manageExceptions The manageExceptions to set.
      */
     public void setManageExceptions(boolean manageExceptions) {
@@ -778,24 +673,6 @@
         this.checkWriteable();
         this.checkSubSetting();
         this.workDirectory = workDirectory;
-    }
-
-    /**
-     * @param logger The logger for the environment.
-     */
-    public void setEnvironmentLogger(String logger) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.environmentLogger = logger;
-    }
-
-    /**
-     * @param overrideLogLevel The overrideLogLevel to set.
-     */
-    public void setOverrideLogLevel(String overrideLogLevel) {
-        this.checkWriteable();
-        this.checkSubSetting();
-        this.overrideLogLevel = overrideLogLevel;
     }
 
     /**

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/BeanFactoryFactoryImpl.java
Sun Sep  3 07:40:20 2006
@@ -25,9 +25,9 @@
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
+import org.apache.cocoon.core.container.spring.avalon.ClassLoaderUtils;
 import org.apache.cocoon.core.container.spring.ConfigReader;
 import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
-import org.apache.cocoon.core.container.util.ClassLoaderUtils;
 import org.apache.cocoon.environment.Request;
 import org.apache.excalibur.source.SourceResolver;
 import org.springframework.beans.BeansException;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/ConfigReader.java
Sun Sep  3 07:40:20 2006
@@ -33,8 +33,8 @@
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
 import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
+import org.apache.cocoon.core.container.spring.avalon.ConfigurationBuilder;
 import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
-import org.apache.cocoon.core.container.util.ConfigurationBuilder;
 import org.apache.cocoon.util.WildcardMatcherHelper;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
Sun Sep  3 07:40:20 2006
@@ -21,18 +21,19 @@
 import javax.servlet.ServletContext;
 
 import org.apache.avalon.excalibur.logger.Log4JConfLoggerManager;
-import org.apache.avalon.excalibur.logger.ServletLogger;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
+import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 import org.apache.avalon.framework.context.DefaultContext;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.cocoon.configuration.Settings;
-import org.apache.cocoon.core.container.util.ConfigurationBuilder;
-import org.apache.cocoon.core.container.util.SettingsContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.FactoryBean;
 import org.springframework.web.context.ServletContextAware;
 
 /**
+ * Spring factory bean to setup the Avalon logger.
  *
  * @since 2.2
  * @version $Id$
@@ -40,6 +41,9 @@
 public class AvalonLoggerFactoryBean
     implements FactoryBean, ServletContextAware {
 
+    /** Logger (we use the same logging mechanism as Spring!) */
+    protected final Log log = LogFactory.getLog(getClass());
+
     /** The servlet context. */
     protected ServletContext servletContext;
 
@@ -58,43 +62,20 @@
         this.servletContext = sContext;
     }
 
-    /**
-     * Create a bootstrap logger that uses the servlet context
-     * @param servletContext
-     * @param logLevelString
-     * @return the logger
-     */
-    protected Logger createBootstrapLogger(String logLevelString) {
-        // create a bootstrap logger
-        int logLevel;
-        if ( "DEBUG".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_DEBUG;
-        } else if ( "WARN".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_WARN;
-        } else if ( "ERROR".equalsIgnoreCase(logLevelString) ) {
-            logLevel = ServletLogger.LEVEL_ERROR;
-        } else {
-            logLevel = ServletLogger.LEVEL_INFO;
-        }
-        return new ServletLogger(this.servletContext, "Cocoon", logLevel);
-    }
-
     protected void init()
     throws Exception {
-        // create a bootstrap logger
-        final String logLevelString = settings.getBootstrapLogLevel();
-        final Logger bootstrapLogger = this.createBootstrapLogger(logLevelString);
+        // create log directory
+        final File logSCDir = new File(settings.getWorkDirectory(), "cocoon-logs");
+        logSCDir.mkdirs();
 
         // create an own context for the logger manager
         final DefaultContext subcontext = new SettingsContext(settings);
         subcontext.put("context-work", new File(settings.getWorkDirectory()));
-        final File logSCDir = new File(settings.getWorkDirectory(), "cocoon-logs");
-        logSCDir.mkdirs();
         subcontext.put("log-dir", logSCDir.toString());
         subcontext.put("servlet-context", servletContext);
 
         final Log4JConfLoggerManager loggerManager = new Log4JConfLoggerManager();
-        loggerManager.enableLogging(bootstrapLogger);
+        loggerManager.enableLogging(new LoggerWrapper(this.log));
         loggerManager.contextualize(subcontext);
 
         // Configure the log4j manager
@@ -105,36 +86,18 @@
         if ( loggerConfig != null ) {
             final URL url = servletContext.getResource(loggerConfig);
             if ( url != null ) {
-                final ConfigurationBuilder builder = new ConfigurationBuilder(settings);
+                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(true);
                 final Configuration conf = builder.build(servletContext.getResourceAsStream(loggerConfig));
-                // override log level?
-                if (settings.getOverrideLogLevel() != null) {
-                    changeLogLevel(conf.getChildren(), settings.getOverrideLogLevel());
-                }
                 loggerManager.configure(conf);
             } else {
-                bootstrapLogger.warn("The logging configuration '" + loggerConfig + "' is
not available.");
+                this.log.warn("The logging configuration '" + loggerConfig + "' is not available.");
                 loggerManager.configure(new DefaultConfiguration("empty"));
             }
         } else {
             loggerManager.configure(new DefaultConfiguration("empty"));
         }
 
-        String accesslogger = settings.getEnvironmentLogger();
-        if (accesslogger == null) {
-            accesslogger = "cocoon";
-        }
-        this.logger = loggerManager.getLoggerForCategory(accesslogger);
-    }
-
-    protected static void changeLogLevel(Configuration[] configs, String level) {
-        for(int i=0; i<configs.length; i++) {
-            if ( configs[i].getName().equals("priority") ) {
-                // we now that this is a DefaultConfiguration
-                ((DefaultConfiguration)configs[i]).setAttribute("value", level);
-            }
-            changeLogLevel(configs[i].getChildren(), level);
-        }
+        this.logger = loggerManager.getLoggerForCategory("cocoon");
     }
 
     /**
@@ -158,19 +121,132 @@
         return true;
     }
 
-    public Settings getSettings() {
-        return settings;
-    }
-
     public void setSettings(Settings settings) {
         this.settings = settings;
     }
 
-    public String getLoggingConfiguration() {
-        return loggingConfiguration;
-    }
-
     public void setLoggingConfiguration(String loggingConfiguration) {
         this.loggingConfiguration = loggingConfiguration;
+    }
+
+    protected static final class LoggerWrapper implements Logger {
+
+        protected final Log log;
+
+        public LoggerWrapper(Log l) {
+            this.log = l;
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#debug(java.lang.String, java.lang.Throwable)
+         */
+        public void debug(String arg0, Throwable arg1) {
+            log.debug(arg0, arg1);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#debug(java.lang.String)
+         */
+        public void debug(String arg0) {
+            log.debug(arg0);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#error(java.lang.String, java.lang.Throwable)
+         */
+        public void error(String arg0, Throwable arg1) {
+            log.error(arg0, arg1);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#error(java.lang.String)
+         */
+        public void error(String arg0) {
+            log.error(arg0);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#fatalError(java.lang.String, java.lang.Throwable)
+         */
+        public void fatalError(String arg0, Throwable arg1) {
+            log.fatal(arg0, arg1);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#fatalError(java.lang.String)
+         */
+        public void fatalError(String arg0) {
+            log.fatal(arg0);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#info(java.lang.String, java.lang.Throwable)
+         */
+        public void info(String arg0, Throwable arg1) {
+            log.info(arg0, arg1);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#info(java.lang.String)
+         */
+        public void info(String arg0) {
+            log.info(arg0);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#isDebugEnabled()
+         */
+        public boolean isDebugEnabled() {
+            return log.isDebugEnabled();
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#isErrorEnabled()
+         */
+        public boolean isErrorEnabled() {
+            return log.isErrorEnabled();
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#isInfoEnabled()
+         */
+        public boolean isInfoEnabled() {
+            return log.isInfoEnabled();
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#isWarnEnabled()
+         */
+        public boolean isWarnEnabled() {
+            return log.isWarnEnabled();
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#warn(java.lang.String, java.lang.Throwable)
+         */
+        public void warn(String arg0, Throwable arg1) {
+            log.warn(arg0, arg1);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#warn(java.lang.String)
+         */
+        public void warn(String arg0) {
+            log.warn(arg0);
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#getChildLogger(java.lang.String)
+         */
+        public Logger getChildLogger(String arg0) {
+            return this;
+        }
+
+        /**
+         * @see org.apache.avalon.framework.logger.Logger#isFatalErrorEnabled()
+         */
+        public boolean isFatalErrorEnabled() {
+            return this.log.isFatalEnabled();
+        }
     }
 }

Copied: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ClassLoaderUtils.java
(from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ClassLoaderUtils.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ClassLoaderUtils.java?p2=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ClassLoaderUtils.java&p1=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ClassLoaderUtils.java&r1=439550&r2=439784&rev=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ClassLoaderUtils.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ClassLoaderUtils.java
Sun Sep  3 07:40:20 2006
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.util;
+package org.apache.cocoon.core.container.spring.avalon;
 
 import java.util.Iterator;
 

Copied: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationBuilder.java
(from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationBuilder.java?p2=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationBuilder.java&p1=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java&r1=439550&r2=439784&rev=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/ConfigurationBuilder.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationBuilder.java
Sun Sep  3 07:40:20 2006
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.util;
+package org.apache.cocoon.core.container.spring.avalon;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -95,7 +95,7 @@
     private Locator locator;
     private final NamespaceSupport namespaceSupport = new NamespaceSupport();
     private final Settings settings;
-    
+
     /**
      * Create a Configuration Builder
      */

Copied: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SettingsContext.java
(from r439550, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SettingsContext.java?p2=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SettingsContext.java&p1=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java&r1=439550&r2=439784&rev=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/util/SettingsContext.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/avalon/SettingsContext.java
Sun Sep  3 07:40:20 2006
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.core.container.util;
+package org.apache.cocoon.core.container.spring.avalon;
 
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
Sun Sep  3 07:40:20 2006
@@ -156,10 +156,16 @@
     private Source libDirectory;
 
 
-    public void contextualize(Context context) throws ContextException {
-        this.context = context;
+    /**
+     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
+     */
+    public void contextualize(Context avalonContext) throws ContextException {
+        this.context = avalonContext;
     }
 
+    /**
+     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
+     */
     public void configure(Configuration configuration) throws ConfigurationException {
         this.showContinuations = configuration.getChild("show-continuations").getValueAsBoolean(true);
         this.showLibrary = configuration.getChild("show-libraries").getValueAsBoolean(true);
@@ -170,8 +176,8 @@
      * <code>Serviceable</code>.
      * Need to get statistics about cache hits
      */
-    public void service(ServiceManager manager) throws ServiceException {
-        super.service(manager);
+    public void service(ServiceManager serviceManager) throws ServiceException {
+        super.service(serviceManager);
         this.settings = (Settings) this.manager.lookup(Settings.ROLE);
 
         if (this.manager.hasService(StoreJanitor.ROLE)) {
@@ -454,10 +460,6 @@
 
         this.addValue("Running mode", s.getRunningMode());
         this.addMultilineValue(Settings.KEY_LOAD_CLASSES, s.getLoadClasses());
-        this.addValue(Settings.KEY_LOGGING_BOOTSTRAP_LOGLEVEL, s.getBootstrapLogLevel());
-        this.addValue(Settings.KEY_LOGGING_COCOON_LOGGER, s.getCocoonLogger());
-        this.addValue(Settings.KEY_LOGGING_ENVIRONMENT_LOGGER, s.getEnvironmentLogger());
-        this.addValue(Settings.KEY_LOGGING_OVERRIDE_LOGLEVEL, s.getOverrideLogLevel());
         this.addValue(Settings.KEY_MANAGE_EXCEPTIONS, s.isManageExceptions());
         this.addValue(Settings.KEY_UPLOADS_DIRECTORY, s.getUploadDirectory());
         this.addValue(Settings.KEY_CACHE_DIRECTORY, s.getCacheDirectory());

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/log4j.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/log4j.xconf?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/log4j.xconf (original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/log4j.xconf Sun Sep  3
07:40:20 2006
@@ -30,7 +30,7 @@
     </appender>
 
     <root>
-      <priority value="error"/>
+      <priority value="${org.apache.cocoon.log4j.loglevel}"/>
       <appender-ref ref="COCOON_DEFAULT" />
     </root>
 </log4j:configuration>

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties
(original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/core.properties
Sun Sep  3 07:40:20 2006
@@ -33,28 +33,6 @@
 #org.apache.cocoon.reloading.config=yes
 #org.apache.cocoon.reloading.flow=yes
 
-# This parameter indicates the category id of the logger
-# configuration used by the environment Cocoon runs in (CLI, Servlet etc.).
-org.apache.cocoon.logging.category.environment=access
-
-# This parameter indicates the category id of the logger from the
-# logging system for the Cocoon engine.
-# This logger is used for all components described in the cocoon.xconf
-# and sitemap.xmap file not having specified a logger with the
-# logger="..." attribute in the component configuration file.
-org.apache.cocoon.logging.category.cocoon=core
-
-# This parameter indicates the log level to use throughout startup of the
-# system. As soon as the logging system is set up, the setting of the
-# logging system is used instead!
-# Available levels are:
-#       DEBUG:        prints all level of log messages.
-#       INFO:         prints all level of log messages except DEBUG ones.
-#       WARN:         prints all level of log messages except DEBUG and INFO ones.
-#       ERROR:        prints all level of log messages except DEBUG, INFO and WARN ones.
-#       FATAL_ERROR:  prints only log messages of this level
-org.apache.cocoon.logging.bootstrap.loglevel=WARN
-
 # Causes all files in multipart requests to be processed.
 # Default is true but the maximum allowed size is kept small for security reasons.
 # Unsupported values will be interpreted as false.
@@ -137,3 +115,8 @@
 # Set form encoding. This will be the character set used to decode request
 # parameters. If not set the ISO-8859-1 encoding will be assumed.
 org.apache.cocoon.formencoding=ISO-8859-1
+
+# If you're using the Avalon bridge and the Log4J logger (which is the default
+# logger for the Avalon bridge), then you can define the loglevel with this
+# property.
+org.apache.cocoon.log4j.loglevel=error
\ No newline at end of file

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/dev/core.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/dev/core.properties?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/dev/core.properties
(original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/dev/core.properties
Sun Sep  3 07:40:20 2006
@@ -14,7 +14,7 @@
 #
 
 # Turn on debug logging
-org.apache.cocoon.override.loglevel=DEBUG
+org.apache.cocoon.log4j.loglevel=debug
 
 # Turn on reloading for all parts
 org.apache.cocoon.reloading=yes

Modified: cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/prod/core.properties
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/prod/core.properties?rev=439784&r1=439783&r2=439784&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/prod/core.properties
(original)
+++ cocoon/trunk/core/cocoon-webapp/src/main/webapp/WEB-INF/cocoon/properties/prod/core.properties
Sun Sep  3 07:40:20 2006
@@ -13,3 +13,4 @@
 #  limitations under the License.
 #
 
+



Mime
View raw message