geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r406500 - in /geronimo/branches/1.1: 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 Mon, 15 May 2006 02:13:20 GMT
Author: djencks
Date: Sun May 14 19:13:19 2006
New Revision: 406500

URL: http://svn.apache.org/viewcvs?rev=406500&view=rev
Log:
GERONIMO-1569 backport packaging plugin logging improvements from trunk

Modified:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.jelly
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.properties
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java?rev=406500&r1=406499&r2=406500&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/log/GeronimoLogging.java
Sun May 14 19:13:19 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 = ERROR;
     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/branches/1.1/plugins/geronimo-packaging-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.jelly?rev=406500&r1=406499&r2=406500&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.jelly (original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.jelly Sun May 14 19:13:19
2006
@@ -68,6 +68,7 @@
             endorsedDirs="${geronimo.packaging.endorsedDirs}"
             extensionDirs="${geronimo.packaging.extensionDirs}"
             explicitResolutionLocation="${geronimo.packaging.explicit.versions}"
+            logLevel="${geronimo.packaging.logLevel}"
             />
     </goal>
 

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.properties?rev=406500&r1=406499&r2=406500&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.properties (original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/plugin.properties Sun May 14 19:13:19
2006
@@ -48,3 +48,4 @@
 geronimo.packaging.install.targetRepositoryClass=org.apache.geronimo.system.repository.Maven1Repository
 geronimo.packaging.install.targetConfigurationStoreClass=org.apache.geronimo.plugin.packaging.MavenConfigStore
 geronimo.packaging.install.targetRepositoryLocation=${maven.repo.local}
+geronimo.packaging.logLevel=WARN

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=406500&r1=406499&r2=406500&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Sun May 14 19:13:19 2006
@@ -18,11 +18,11 @@
 
 import java.io.File;
 import java.net.URI;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Collection;
 import java.util.Set;
-import java.util.HashSet;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -35,15 +35,15 @@
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.KernelConfigurationManager;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.system.resolver.ExplicitDefaultArtifactResolver;
-import org.apache.log4j.BasicConfigurator;
 
 /**
  * JellyBean that builds a Geronimo Configuration using the local Mavem
@@ -103,6 +103,7 @@
     private String endorsedDirs;
     private String extensionDirs;
     private String explicitResolutionLocation;
+    private String logLevel;
 
     private boolean targetSet;
 
@@ -294,6 +295,13 @@
         this.explicitResolutionLocation = explicitResolutionLocation;
     }
 
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    public void setLogLevel(String logLevel) {
+        this.logLevel = logLevel;
+    }
 
     public void execute() throws Exception {
         System.out.println();
@@ -359,7 +367,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/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java?rev=406500&r1=406499&r2=406500&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilderShell.java
Sun May 14 19:13:19 2006
@@ -70,6 +70,7 @@
     private String endorsedDirs;
     private String extensionDirs;
     private String explicitResolutionLocation;
+    private String logLevel = "INFO";
 
     public File getRepository() {
         return repository;
@@ -254,6 +255,14 @@
         this.explicitResolutionLocation = explicitResolutionLocation;
     }
 
+    public String getLogLevel() {
+        return logLevel;
+    }
+
+    public void setLogLevel(String logLevel) {
+        this.logLevel = logLevel;
+    }
+
     public void execute() throws Exception {
         try {
             Object packageBuilder = getPackageBuilder();
@@ -276,6 +285,7 @@
             set("setTargetRepositoryClass", Maven2Repository.class.getName(), String.class,
packageBuilder);
             set("setTargetConfigurationStoreClass", RepositoryConfigurationStore.class.getName(),
String.class, packageBuilder);
             set("setExplicitResolutionLocation", explicitResolutionLocation, 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