geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r374191 - in /geronimo/trunk: etc/ modules/kernel/src/java/org/apache/geronimo/kernel/log/ plugins/geronimo-packaging-plugin/ plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/
Date Wed, 01 Feb 2006 22:01:49 GMT
Author: djencks
Date: Wed Feb  1 14:01:44 2006
New Revision: 374191

URL: http://svn.apache.org/viewcvs?rev=374191&view=rev
Log:
GERONIMO-1569 Improve packaging plugin logging

Modified:
    geronimo/trunk/etc/project.properties
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
    geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly
    geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties
    geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java

Modified: geronimo/trunk/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/etc/project.properties (original)
+++ geronimo/trunk/etc/project.properties Wed Feb  1 14:01:44 2006
@@ -85,7 +85,7 @@
 tranql_vendors_version=1.1
 release_notes_version=1.0
 
-geronimo_packaging_plugin_version=1.1.2
+geronimo_packaging_plugin_version=1.1.3
 geronimo_assembly_plugin_version=1.1.6
 geronimo_deployment_plugin_version=1.1.1
 geronimo_dependency_plugin_version=1.1.1

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
Wed Feb  1 14:01:44 2006
@@ -18,6 +18,8 @@
 package org.apache.geronimo.kernel.log;
 
 import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.HashMap;
 
 import org.apache.commons.logging.LogFactory;
 
@@ -25,6 +27,10 @@
  * @version $Rev$ $Date$
  */
 public class GeronimoLogging {
+
+    //this needs to go before the instance constants or you get an NPE in the constructor.
+    private static final Map levels = new HashMap();
+
     public static final GeronimoLogging TRACE = new GeronimoLogging("TRACE");
     public static final GeronimoLogging DEBUG = new GeronimoLogging("DEBUG");
     public static final GeronimoLogging INFO = new GeronimoLogging("INFO");
@@ -36,6 +42,7 @@
     private static GeronimoLogging consoleLogLevel;
     private static GeronimoLogging defaultLevel;
 
+
     /**
      * Initializes the logging system used by Geronimo.  This MUST be called in
      * in the main class used to start the geronimo server.  This method forces
@@ -86,10 +93,15 @@
         GeronimoLogging.consoleLogLevel = consoleLogLevel;
     }
 
+    public static GeronimoLogging getGeronimoLogging(String level) {
+        return (GeronimoLogging) levels.get(level);
+    }
+
     private final String level;
 
     private GeronimoLogging(String level) {
         this.level = level;
+        levels.put(level, this);
     }
 
     public String toString() {

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly Wed Feb  1 14:01:44 2006
@@ -65,6 +65,7 @@
             classPath="${geronimo.packaging.classPath}"
             endorsedDirs="${geronimo.packaging.endorsedDirs}"
             extensionDirs="${geronimo.packaging.extensionDirs}"
+            logLevel="${geronimo.packaging.logLevel}"
             />
     </goal>
 

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties Wed Feb  1 14:01:44
2006
@@ -37,3 +37,4 @@
 geronimo.packaging.protocol=rmi://${geronimo.packaging.hostname}/jndi/rmi
 geronimo.packaging.sap=/JMXConnector
 geronimo.packaging.url=service:jmx:${geronimo.packaging.protocol}:${geronimo.packaging.sap}
+geronimo.packaging.logLevel=WARN

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml Wed Feb  1 14:01:44 2006
@@ -22,7 +22,7 @@
     <groupId>geronimo</groupId>
     <id>geronimo-packaging-plugin</id>
     <name>Geronimo :: Maven Packaging Plugin</name>
-    <currentVersion>1.1.2</currentVersion>
+    <currentVersion>1.1.3</currentVersion>
 
     <dependencies>
         <dependency>

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
(original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Wed Feb  1 14:01:44 2006
@@ -30,6 +30,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
@@ -111,6 +112,7 @@
     private String classPath;
     private String endorsedDirs;
     private String extensionDirs;
+    private String logLevel;
 
     public String getRepositoryClass() {
         return repositoryClass;
@@ -254,9 +256,17 @@
         this.extensionDirs = extensionDirs;
     }
 
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    public void setLogLevel(String logLevel) {
+        this.logLevel = logLevel;
+    }
+
     public void execute() throws Exception {
         try {
-            Kernel kernel = createKernel(repository, repositoryClass, configurationStoreClass);
+            Kernel kernel = createKernel(repository, repositoryClass, configurationStoreClass,
logLevel);
 
             // start the Configuration we're going to use for this deployment
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
@@ -292,7 +302,7 @@
     /**
      * Create a Geronimo Kernel to contain the deployment configurations.
      */
-    private static synchronized Kernel createKernel(File repository, String repoClass, String
configStoreClass) throws Exception {
+    private static synchronized Kernel createKernel(File repository, String repoClass, String
configStoreClass, String logLevel) throws Exception {
         // first return our cached version
         if (kernel != null) {
             return kernel;
@@ -304,7 +314,11 @@
             return kernel;
         }
 
-        BasicConfigurator.configure();
+        GeronimoLogging geronimoLogging = GeronimoLogging.getGeronimoLogging(logLevel);
+        if (geronimoLogging == null) {
+            geronimoLogging = GeronimoLogging.DEBUG;
+        }
+        GeronimoLogging.initialize(geronimoLogging);
         // boot one ourselves
         kernel = KernelFactory.newInstance().createKernel(KERNEL_NAME);
         kernel.boot();

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java?rev=374191&r1=374190&r2=374191&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
(original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
Wed Feb  1 14:01:44 2006
@@ -62,6 +62,7 @@
     private String endorsedDirs;
     private String extensionDirs;
     private static final String PACKAGING_CLASSPATH_PROPERTY = "packaging.classpath";
+    private String logLevel = "INFO";
 
     public File getRepository() {
         return repository;
@@ -202,6 +203,14 @@
         this.context = context;
     }
 
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    public void setLogLevel(String logLevel) {
+        this.logLevel = logLevel;
+    }
+
     public void execute() throws Exception {
         try {
             Object packageBuilder = getPackageBuilder();
@@ -217,6 +226,7 @@
             set("setRepository", repository, File.class, packageBuilder);
             set("setRepositoryClass", MavenRepository.class.getName(), String.class, packageBuilder);
             set("setConfigurationStoreClass", MavenConfigStore.class.getName(), String.class,
packageBuilder);
+            set("setLogLevel", logLevel, String.class, packageBuilder);
 
             Method m = packageBuilder.getClass().getMethod("execute", new Class[]{});
             m.invoke(packageBuilder, new Object[]{});



Mime
View raw message