geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r835085 - in /geronimo/server/trunk/framework: configs/client-system/ configs/client-system/src/main/history/ configs/j2ee-system/ configs/j2ee-system/src/main/history/ configs/karaf-framework/ configs/karaf-framework/src/main/distribution/...
Date Wed, 11 Nov 2009 21:54:41 GMT
Author: gawor
Date: Wed Nov 11 21:54:40 2009
New Revision: 835085

URL: http://svn.apache.org/viewvc?rev=835085&view=rev
Log:
some more logging updates: 1) use geronimo log4j.properties files to configure logging, 2) expose service to configure logging programtically, 3) remove unused geronimo-logging module

Added:
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml   (with props)
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java   (contents, props changed)
      - copied, changed from r835011, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java   (contents, props changed)
      - copied, changed from r835011, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java   (with props)
Removed:
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg
    geronimo/server/trunk/framework/modules/geronimo-logging/
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
Modified:
    geronimo/server/trunk/framework/configs/client-system/pom.xml
    geronimo/server/trunk/framework/configs/client-system/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/configs/j2ee-system/pom.xml
    geronimo/server/trunk/framework/configs/j2ee-system/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/configs/karaf-framework/pom.xml
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/client
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/client.bat
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/startup.properties
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/history/dependencies.xml
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
    geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
    geronimo/server/trunk/framework/modules/geronimo-management/pom.xml
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JVM.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
    geronimo/server/trunk/framework/modules/pom.xml

Modified: geronimo/server/trunk/framework/configs/client-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/client-system/pom.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/client-system/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/client-system/pom.xml Wed Nov 11 21:54:40 2009
@@ -111,8 +111,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-service</artifactId>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-pax-logging</artifactId>
+            <version>${version}</version>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/framework/configs/client-system/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/client-system/src/main/history/dependencies.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/client-system/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/framework/configs/client-system/src/main/history/dependencies.xml Wed Nov 11 21:54:40 2009
@@ -63,6 +63,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-pax-logging</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-system</artifactId>
         <type>jar</type>
     </dependency>
@@ -131,9 +136,4 @@
         <artifactId>pax-logging-api</artifactId>
         <type>jar</type>
     </dependency>
-    <dependency>
-        <groupId>org.ops4j.pax.logging</groupId>
-        <artifactId>pax-logging-service</artifactId>
-        <type>jar</type>
-    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/framework/configs/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/pom.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-system/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-system/pom.xml Wed Nov 11 21:54:40 2009
@@ -164,8 +164,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-service</artifactId>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-pax-logging</artifactId>
+            <version>${version}</version>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/framework/configs/j2ee-system/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/src/main/history/dependencies.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-system/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-system/src/main/history/dependencies.xml Wed Nov 11 21:54:40 2009
@@ -78,6 +78,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-pax-logging</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-system</artifactId>
         <type>jar</type>
     </dependency>
@@ -156,9 +161,4 @@
         <artifactId>pax-logging-api</artifactId>
         <type>jar</type>
     </dependency>
-    <dependency>
-        <groupId>org.ops4j.pax.logging</groupId>
-        <artifactId>pax-logging-service</artifactId>
-        <type>jar</type>
-    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/framework/configs/karaf-framework/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/pom.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/pom.xml (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/pom.xml Wed Nov 11 21:54:40 2009
@@ -134,6 +134,18 @@
             </dependency>
 
             <dependency>
+                <groupId>org.apache.felix.karaf.shell</groupId>
+                <artifactId>org.apache.felix.karaf.shell.log</artifactId>
+                <version>${felix.karaf.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.ops4j.pax.logging</groupId>
+                        <artifactId>pax-logging-service</artifactId>
+                    </exclusion>
+               </exclusions>
+            </dependency>
+
+            <dependency>
                 <groupId>org.apache.felix.karaf.deployer</groupId>
                 <artifactId>org.apache.felix.karaf.deployer.blueprint</artifactId>
                 <version>${felix.karaf.version}</version>
@@ -379,8 +391,9 @@
             <artifactId>pax-logging-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-service</artifactId>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-pax-logging</artifactId>
+            <version>${version}</version>
         </dependency>
         <dependency>
             <groupId>org.ops4j.pax.url</groupId>

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/client
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/client?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/client (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/client Wed Nov 11 21:54:40 2009
@@ -285,7 +285,7 @@
         KARAF_BASE=`cygpath --path --windows "$KARAF_BASE"`
         CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
     fi
-    exec $JAVA $JAVA_OPTS -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.geronimo.cli.client.ClientCLI "$@"
+    exec $JAVA $JAVA_OPTS -Dorg.apache.geronimo.home.dir="$KARAF_HOME" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.geronimo.cli.client.ClientCLI "$@"
 }
 
 main() {

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo Wed Nov 11 21:54:40 2009
@@ -285,7 +285,7 @@
         KARAF_BASE=`cygpath --path --windows "$KARAF_BASE"`
         CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
     fi
-    exec $JAVA $JAVA_OPTS -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.geronimo.cli.daemon.DaemonCLI "$@"
+    exec $JAVA $JAVA_OPTS -Dorg.apache.geronimo.home.dir="$KARAF_HOME" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.geronimo.cli.daemon.DaemonCLI "$@"
 }
 
 main() {

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/client.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/client.bat?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/client.bat (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/client.bat Wed Nov 11 21:54:40 2009
@@ -152,7 +152,7 @@
     if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8
     if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8    
     rem Execute the Java Virtual Machine
-    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.geronimo.cli.client.ClientCLI %ARGS%
+    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dorg.apache.geronimo.home.dir="%KARAF_HOME%" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.geronimo.cli.client.ClientCLI %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat Wed Nov 11 21:54:40 2009
@@ -152,7 +152,7 @@
     if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8
     if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8    
     rem Execute the Java Virtual Machine
-    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.geronimo.cli.daemon.DaemonCLI %ARGS%
+    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dorg.apache.geronimo.home.dir="%KARAF_HOME%" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.geronimo.cli.daemon.DaemonCLI %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/startup.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/startup.properties?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/startup.properties (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/filtered-resources/etc/startup.properties Wed Nov 11 21:54:40 2009
@@ -26,8 +26,9 @@
 org/ops4j/pax/url/pax-url-mvn/${pax.url.version}/pax-url-mvn-${pax.url.version}.jar=5
 org/ops4j/pax/url/pax-url-wrap/${pax.url.version}/pax-url-wrap-${pax.url.version}.jar=5
 org/ops4j/pax/logging/pax-logging-api/${pax.logging.version}/pax-logging-api-${pax.logging.version}.jar=8
-org/ops4j/pax/logging/pax-logging-service/${pax.logging.version}/pax-logging-service-${pax.logging.version}.jar=8
-org/apache/felix/org.apache.felix.configadmin/${felix.configadmin.version}/org.apache.felix.configadmin-${felix.configadmin.version}.jar=10
+org/apache/felix/org.apache.felix.configadmin/${felix.configadmin.version}/org.apache.felix.configadmin-${felix.configadmin.version}.jar=8
+org/apache/geronimo/framework/geronimo-pax-logging/${pom.version}/geronimo-pax-logging-${pom.version}.jar=9
+#org/ops4j/pax/logging/pax-logging-service/${pax.logging.version}/pax-logging-service-${pax.logging.version}.jar=9
 org/apache/felix/org.apache.felix.prefs/${felix.prefs.version}/org.apache.felix.prefs-${felix.prefs.version}.jar=10
 org/apache/felix/org.apache.felix.fileinstall/${felix.fileinstall.version}/org.apache.felix.fileinstall-${felix.fileinstall.version}.jar=10
 

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/history/dependencies.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/history/dependencies.xml Wed Nov 11 21:54:40 2009
@@ -192,6 +192,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-pax-logging</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-servlet_3.0_spec</artifactId>
         <type>jar</type>
@@ -232,11 +237,6 @@
         <type>jar</type>
     </dependency>
     <dependency>
-        <groupId>org.ops4j.pax.logging</groupId>
-        <artifactId>pax-logging-service</artifactId>
-        <type>jar</type>
-    </dependency>
-    <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-mvn</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java Wed Nov 11 21:54:40 2009
@@ -48,6 +48,7 @@
         boot.setWaitForStop(false);
         boot.setUniqueStorage(true);
         boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/client-system/3.0-SNAPSHOT/car"));
+        boot.setLog4jConfigFile("var/log/client-log4j.properties");
         return boot;
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java Wed Nov 11 21:54:40 2009
@@ -47,6 +47,7 @@
         Bootstrapper boot = super.createBootstrapper();
         boot.setWaitForStop(true);
         boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car"));
+        boot.setLog4jConfigFile("var/log/server-log4j.properties");
         return boot;
     }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/Bootstrapper.java Wed Nov 11 21:54:40 2009
@@ -30,12 +30,14 @@
  * @version $Rev$ $Date$
  */
 public class Bootstrapper {
-
+    
     private org.apache.felix.karaf.main.Main main;
     private boolean waitForStop = true;    
     private List<String> bundles;
     private int defaultStartLevel = 100;
-    private boolean uniqueStorage = false;
+    private boolean uniqueStorage = false;   
+    private ServerInfo serverInfo;
+    private String log4jFile;
 
     public Bootstrapper() {
         main = new org.apache.felix.karaf.main.Main(null);
@@ -53,6 +55,10 @@
         this.uniqueStorage = uniqueStorage;
     }
     
+    public void setLog4jConfigFile(String log4jFile) {
+        this.log4jFile = log4jFile;
+    }
+    
     public int execute(Object opaque) {
         int exitCode;
         
@@ -61,6 +67,8 @@
             return exitCode;
         }
         
+        main.getFramework().getBundleContext().registerService(ServerInfo.class.getName(), serverInfo, null);
+        
         if (bundles != null) {
             StartLevelListener listener = new StartLevelListener(this);
             listener.start();            
@@ -102,15 +110,46 @@
         return main;
     }
     
-    public int launch() {        
+    public int launch() {      
         try {
-            System.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, String.valueOf(defaultStartLevel));
-            System.setProperty(Constants.FRAMEWORK_STORAGE, getStorageDirectory());
+            File geronimoHome = Utils.getGeronimoHome();
+            File geronimoBase = Utils.getGeronimoBase(geronimoHome);
+            File temporaryDir = Utils.getTempDirectory(geronimoBase);
+            File log4jConfigFile = Utils.getLog4jConfigurationFile(geronimoBase, log4jFile);
+            
+            System.setProperty(Utils.HOME_DIR_SYS_PROP, 
+                               geronimoHome.getAbsolutePath());
+            
+            System.setProperty(Utils.SERVER_DIR_SYS_PROP,
+                                geronimoBase.getAbsolutePath());
+            
+            System.setProperty("java.io.tmpdir", 
+                               temporaryDir.getAbsolutePath());
+            
+            if (log4jConfigFile != null) {
+                System.setProperty("org.apache.geronimo.log4jservice.configuration",
+                                   log4jConfigFile.getAbsolutePath());
+            }
             
+            serverInfo = new ServerInfo(geronimoHome, geronimoBase);
+                        
+            System.setProperty(Constants.FRAMEWORK_STORAGE, 
+                               getStorageDirectory());
+            
+            System.setProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL, 
+                               String.valueOf(defaultStartLevel));            
+            
+        } catch (IOException e) {
+            e.printStackTrace();
+            return -1;
+        }
+        
+        try {           
             main.launch();
         } catch (Exception e) {
             e.printStackTrace();           
         }
+        
         return main.getExitCode();
     }
     
@@ -173,12 +212,12 @@
     private String getStorageDirectory() throws IOException {
         File storage;
         if (uniqueStorage) {
-            File var = new File(getHome(), "var");
+            File var = new File(getServer(), "var");
             File tmpFile = File.createTempFile("appclient-", "", var);
             storage = new File(var, tmpFile.getName() + "-cache");
             tmpFile.delete();
         } else {
-            storage = new File(getHome(), "var/cache");
+            storage = new File(getServer(), "var/cache");
         }
                 
         storage.mkdirs();
@@ -186,7 +225,11 @@
     }
     
     private String getHome() {
-        return System.getProperty(org.apache.felix.karaf.main.Main.PROP_KARAF_HOME);
+        return serverInfo.getBase().getAbsolutePath();
+    }
+    
+    private String getServer() {
+        return serverInfo.getBaseServer().getAbsolutePath();
     }
     
     private static boolean recursiveDelete(File root) {

Modified: geronimo/server/trunk/framework/modules/geronimo-management/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/pom.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-management/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/pom.xml Wed Nov 11 21:54:40 2009
@@ -42,6 +42,12 @@
             <artifactId>geronimo-system</artifactId>
             <version>${version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-pax-logging</artifactId>
+            <version>${version}</version>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>

Modified: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JVM.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JVM.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JVM.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JVM.java Wed Nov 11 21:54:40 2009
@@ -20,7 +20,7 @@
 import java.util.Date;
 import java.util.Properties;
 
-import org.apache.geronimo.system.logging.SystemLog;
+import org.apache.geronimo.logging.SystemLog;
 
 /**
  * Geronimo extensions to the standard JSR-77 JVM type.

Added: geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml?rev=835085&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml (added)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml Wed Nov 11 21:54:40 2009
@@ -0,0 +1,84 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You under the Apache License, Version 2.0
+        (the "License"); you may not use this file except in compliance with
+        the License.  You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>modules</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>geronimo-pax-logging</artifactId>
+    <packaging>bundle</packaging>
+    <name>Geronimo Framework, Modules :: PAX Logging</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-main</artifactId>
+            <version>${version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <!--<version>2.0.1-SNAPSHOT</version>-->
+                <configuration>
+                    <instructions>
+                        <Embed-Dependency>pax-logging-service;inline=true</Embed-Dependency>
+ 
+                        <Import-Package>com.sun.jdmk.comm;resolution:=optional,javax.jms;resolution:=optional,javax.mail;resolution:=optional,javax.mail.internet;resolution:=optional,javax.management;resolution:=optional,javax.naming;resolution:=optional,javax.swing;resolution:=optional,javax.swing.border;resolution:=optional,javax.swing.event;resolution:=optional,javax.swing.table;resolution:=optional,javax.swing.text;resolution:=optional,javax.swing.tree;resolution:=optional,javax.xml.parsers,org.knopflerfish.service.log;provider=paxlogging;version="[1.1.0,2.0.0)",org.ops4j.pax.logging;version="[0.9.5,2.0.0)",org.ops4j.pax.logging.spi;provider=paxlogging;version="1.4",org.osgi.framework;version="[1.0.0,2.0.0)",org.osgi.service.cm;version="[1.0.0,2.0.0)",org.osgi.service.log;version="[1.3.0,2.0.0)",org.osgi.util.tracker;version="[1.3.0,2.0.0)",org.w3c.dom,org.xml.sax,org.xml.sax.helpers,*</Import-Package>
+                        <Export-Package>org.apache.geronimo.logging,org.ops4j.pax.logging.spi;provider=paxlogging;version="1.4"</Export-Package>
+                        <!--
+                        <Bundle-Activator>org.ops4j.pax.logging.internal.Activator</Bundle-Activator>
+                        -->
+                        <Bundle-Activator>org.apache.geronimo.logging.impl.LoggingServiceActivator</Bundle-Activator>
+                        <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java (from r835011, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java?p2=geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java&r1=835011&r2=835085&rev=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java Wed Nov 11 21:54:40 2009
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.system.logging;
+package org.apache.geronimo.logging;
 
 import java.io.Serializable;
 

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 11 21:54:40 2009
@@ -0,0 +1,2 @@
+/geronimo/server/branches/2.2/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java:826768
+/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/SystemLog.java:749113,749116-807432,809079-825588

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java (from r835011, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java?p2=geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java&r1=835011&r2=835085&rev=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java Wed Nov 11 21:54:40 2009
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.system.logging.log4j;
+package org.apache.geronimo.logging.impl;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -30,19 +30,15 @@
 import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Properties;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.system.logging.SystemLog;
-import org.apache.geronimo.system.properties.JvmVendor;
-import org.apache.geronimo.system.serverinfo.DirectoryUtils;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.logging.SystemLog;
+import org.apache.geronimo.main.ServerInfo;
 import org.apache.log4j.FileAppender;
 import org.apache.log4j.Level;
 import org.apache.log4j.LogManager;
@@ -53,7 +49,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class Log4jService implements GBeanLifecycle, SystemLog {
+public abstract class Log4jService implements SystemLog {
     // A substitution variable in the file path in the config file
     private final static Pattern VARIABLE_PATTERN = Pattern.compile("\\$\\{.*?\\}");
     // Next 6 are patterns that identify log messages in our default format
@@ -73,7 +69,7 @@
 
     private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Log4jService.class);
 
-    private static final String LOG4JSERVICE_CONFIG_PROPERTY = "org.apache.geronimo.log4jservice.configuration";
+    public static final String LOG4JSERVICE_CONFIG_PROPERTY = "org.apache.geronimo.log4jservice.configuration";
 
     /**
      * The URL to the configuration file.
@@ -109,14 +105,14 @@
      * Is this service running?
      */
     private boolean running = false;
-
+    
     /**
      * Construct a <code>Log4jService</code>.
      *
      * @param configurationFile The log4j configuration file.
      * @param refreshPeriod The refresh refreshPeriod (in seconds).
      */
-    public Log4jService(final String configurationFile, final int refreshPeriod, ServerInfo serverInfo) {
+    public Log4jService(String configurationFile, int refreshPeriod, ServerInfo serverInfo) {
         this.refreshPeriod = refreshPeriod;
         this.configurationFile = configurationFile;
         this.serverInfo = serverInfo;
@@ -523,12 +519,22 @@
         }
 
         try {
-            URLConfigurator.configure(file.toURI().toURL());
-        } catch (MalformedURLException e) {
+            FileInputStream in = new FileInputStream(file);
+            Properties props = new Properties();
+            try {
+                props.load(in);
+            } finally {
+                try { in.close(); } catch (IOException ignore) {}
+            }
+            
+            update(props);                        
+        } catch (Exception e) {
             e.printStackTrace();
-        }
+        }   
     }
 
+    abstract protected void update(Properties properties) throws Exception;      
+    
     private synchronized void schedule() {
         if (timer != null) {
             // kill the old monitor
@@ -544,32 +550,23 @@
         }
     }
 
-    public void doStart() {
-        // Allow users to override the configurationFile which is hardcoded
-        // in config.ser and cannot be updated by config.xml, as the
-        // AttrbiuteManager comes up after this GBean
-        String cfgFile = System.getProperty(LOG4JSERVICE_CONFIG_PROPERTY);
-        if ((cfgFile != null) && (!cfgFile.equals(""))) {
-            this.configurationFile = cfgFile;
-        }
+    public synchronized void start() {
+        reconfigure();
 
-        synchronized (this) {
-            reconfigure();
+        timer = new Timer(true);
 
-            timer = new Timer(true);
+        // Periodically check the configuration file
+        schedule();
 
-            // Periodically check the configuration file
-            schedule();
-        }
-
-        logEnvInfo();
+        log.info("----------------------------------------------");
+        log.info("Started Logging Service");
         
-        synchronized (this) {
-            running = true;
-        }
+        log.debug("Log4jService created with configFileName={}, refreshPeriodSeconds={}", configurationFile, refreshPeriod);
+        
+        running = true;
     }
 
-    public synchronized void doStop() {
+    public synchronized void stop() {
         running = false;
         if (monitor != null) {
             monitor.cancel();
@@ -590,10 +587,6 @@
         }
     }
 
-    public void doFail() {
-        doStop();
-    }
-
     private synchronized File resolveConfigurationFile() {
         try {
             return serverInfo.resolveServer(configurationFile);
@@ -602,43 +595,6 @@
         }
     }
 
-    private void logEnvInfo() {
-       try {
-          log.info("----------------------------------------------");
-          log.info("Started Logging Service");
-          
-          log.debug("Log4jService created with configFileName={}, refreshPeriodSeconds={}", configurationFile, refreshPeriod);
-          
-          log.info("Runtime Information:");
-          log.info("  Install Directory = " + DirectoryUtils.getGeronimoInstallDirectory());
-          log.info("  JVM in use        = " + JvmVendor.getJvmInfo());
-          log.info("Java Information:");
-          log.info("  System property [java.runtime.name]     = " + System.getProperty("java.runtime.name"));
-          log.info("  System property [java.runtime.version]  = " + System.getProperty("java.runtime.version"));
-          log.info("  System property [os.name]               = " + System.getProperty("os.name"));
-          log.info("  System property [os.version]            = " + System.getProperty("os.version"));
-          log.info("  System property [sun.os.patch.level]    = " + System.getProperty("sun.os.patch.level"));
-          log.info("  System property [os.arch]               = " + System.getProperty("os.arch"));
-          log.info("  System property [java.class.version]    = " + System.getProperty("java.class.version"));
-          log.info("  System property [locale]                = " + System.getProperty("user.language") + "_" + System.getProperty("user.country"));
-          log.info("  System property [unicode.encoding]      = " + System.getProperty("sun.io.unicode.encoding"));
-          log.info("  System property [file.encoding]         = " + System.getProperty("file.encoding"));
-          log.info("  System property [java.vm.name]          = " + System.getProperty("java.vm.name"));
-          log.info("  System property [java.vm.vendor]        = " + System.getProperty("java.vm.vendor"));
-          log.info("  System property [java.vm.version]       = " + System.getProperty("java.vm.version"));
-          log.info("  System property [java.vm.info]          = " + System.getProperty("java.vm.info"));
-          log.info("  System property [java.home]             = " + System.getProperty("java.home"));
-          log.info("  System property [java.classpath]        = " + System.getProperty("java.classpath"));
-          log.info("  System property [java.library.path]     = " + System.getProperty("java.library.path"));
-          log.info("  System property [java.endorsed.dirs]    = " + System.getProperty("java.endorsed.dirs"));
-          log.info("  System property [java.ext.dirs]         = " + System.getProperty("java.ext.dirs"));
-          log.info("  System property [sun.boot.class.path]   = " + System.getProperty("sun.boot.class.path"));
-          log.info("----------------------------------------------");
-       } catch (Exception e) {
-          System.err.println("Exception caught during logging of Runtime Information.  Exception=" + e.toString());
-       }
-    }
-
     private class URLMonitorTask extends TimerTask {
         public void run() {
             try {
@@ -665,30 +621,4 @@
         }
     }
     
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(Log4jService.class, "SystemLog");
-
-        infoFactory.addAttribute("configFileName", String.class, true);
-        infoFactory.addAttribute("refreshPeriodSeconds", int.class, true);
-        infoFactory.addAttribute("configuration", String.class, false);
-        infoFactory.addAttribute("rootLoggerLevel", String.class, false);
-
-        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
-
-//        infoFactory.addOperation("reconfigure");
-//        infoFactory.addOperation("setLoggerLevel", new Class[]{String.class, String.class});
-//        infoFactory.addOperation("getLoggerLevel", new Class[]{String.class});
-//        infoFactory.addOperation("getLoggerEffectiveLevel", new Class[]{String.class});
-        infoFactory.addInterface(SystemLog.class);
-
-        infoFactory.setConstructor(new String[]{"configFileName", "refreshPeriodSeconds", "ServerInfo"});
-
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Nov 11 21:54:40 2009
@@ -0,0 +1,2 @@
+/geronimo/server/branches/2.2/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java:826768
+/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java:749113,749116-807432,809079-825588

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java?rev=835085&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java Wed Nov 11 21:54:40 2009
@@ -0,0 +1,67 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.logging.impl;
+
+import org.apache.geronimo.logging.SystemLog;
+import org.apache.geronimo.main.ServerInfo;
+import org.ops4j.pax.logging.internal.Activator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+public class LoggingServiceActivator implements BundleActivator {
+
+    private Activator activator;
+    private Log4jService service;
+    
+    public LoggingServiceActivator() {
+        activator = new Activator();       
+    }
+    
+    public void start(BundleContext context) throws Exception {
+        String config = System.getProperty(Log4jService.LOG4JSERVICE_CONFIG_PROPERTY);
+        if (config != null) {
+            ConfigurationAdmin configAdmin = getService(context, ConfigurationAdmin.class);
+            if (configAdmin != null) {
+                ServerInfo serverInfo = getService(context, ServerInfo.class);
+                Configuration configuration = configAdmin.getConfiguration("org.ops4j.pax.logging");                
+                service = new OSGiLog4jService(config, 60, serverInfo, configuration);
+                service.start();
+                
+                context.registerService(SystemLog.class.getName(), service, null);
+            }
+        }
+        
+        activator.start(context);
+    }
+
+    private <T> T getService(BundleContext context, Class<T> name) {
+        ServiceReference ref = context.getServiceReference(name.getName());
+        return (ref == null) ? null : (T) context.getService(ref);
+    }
+    
+    public void stop(BundleContext context) throws Exception {
+        if (service != null) {
+            service.stop();
+        }    
+        activator.stop(context);       
+    }
+   
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java?rev=835085&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java Wed Nov 11 21:54:40 2009
@@ -0,0 +1,39 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.logging.impl;
+
+import java.util.Properties;
+
+import org.apache.geronimo.main.ServerInfo;
+import org.osgi.service.cm.Configuration;
+
+public class OSGiLog4jService extends Log4jService {
+
+    private Configuration configuration;
+
+    public OSGiLog4jService(String configurationFile, int refreshPeriod, ServerInfo serverInfo, Configuration configuration) {
+        super(configurationFile, refreshPeriod, serverInfo);
+        this.configuration = configuration;
+    }
+
+    @Override
+    protected void update(Properties properties) throws Exception {
+        configuration.update(properties);
+    }
+ 
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java Wed Nov 11 21:54:40 2009
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.system.main;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Hashtable;
@@ -26,7 +25,6 @@
 import java.util.Set;
 
 import org.apache.geronimo.cli.daemon.DaemonCLParser;
-import org.apache.geronimo.common.GeronimoEnvironment;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -41,7 +39,6 @@
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.main.Main;
-import org.apache.geronimo.system.serverinfo.DirectoryUtils;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -107,25 +104,7 @@
     }
 
     protected int doStartup() {
-        try {
-            // Check that the tmpdir exists - if not give friendly msg and exit
-            // since we allow it to be configured in geronimo.bat and geronimo.sh
-            // (since 1.0 release) the same way Tomcat allows it to be configured.
-            String tmpDir = System.getProperty("java.io.tmpdir");
-            if (tmpDir == null || (!(new File(tmpDir)).exists()) || (!(new File(tmpDir)).isDirectory())) {
-                System.err.println("The java.io.tmpdir system property specifies a non-existent directory: " + tmpDir);
-                return 1;
-            }
-
-            /*
-            // Determine the geronimo installation directory
-            File geronimoInstallDirectory = DirectoryUtils.getGeronimoInstallDirectory();
-            if (geronimoInstallDirectory == null) {
-                System.err.println("Could not determine geronimo installation directory");
-                return 1;
-            }
-            */
-            
+        try {            
             int exitCode = initializeKernel();
             if (0 != exitCode) {
                 return exitCode;

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/serverinfo/BasicServerInfo.java Wed Nov 11 21:54:40 2009
@@ -29,7 +29,10 @@
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.system.properties.JvmVendor;
 import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Contains information about the server and functions for resolving
@@ -40,6 +43,9 @@
 
 @GBean
 public class BasicServerInfo implements ServerInfo {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(BasicServerInfo.class);
+    
     public static final String SERVER_NAME_SYS_PROP = "org.apache.geronimo.server.name";
     public static final String SERVER_DIR_SYS_PROP = "org.apache.geronimo.server.dir";
     public static final String HOME_DIR_SYS_PROP = "org.apache.geronimo.home.dir";
@@ -83,50 +89,6 @@
                 throw new IllegalStateException("NO karaf.home specified");
             }
             this.base = new File(karafHome);
-//            if (bundleContext == null) {
-//                throw new IllegalArgumentException("No bundleContext, and no way to determine server location from system properties or explicitly");
-//            }
-//            URL url = bundleContext.getBundle().getResource("META-INF/config.ser");
-//            if (url != null) {
-//                try {
-//                    JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
-//                    url = jarConnection.getJarFileURL();
-//
-//                    URI baseURI = url.toURI();
-//                    while (!baseURI.getPath().endsWith("respository")) {
-//                        baseURI = baseURI.resolve("..");
-//                    }
-//                    base = new File(baseURI);
-//                } catch (Exception ignored) {
-//                    throw new RuntimeException("Error while determining the installation directory of Apache Geronimo", ignored);
-//                }
-//            } else {
-////                log.error("Cound not determine the installation directory of Apache Geronimo, because the startup jar could not be found in the current class loader.");
-//                base = new File(".");
-//            }
-//            File b = null;
-//            try {
-//                String bundleLocation = bundleContext.getBundle().getLocation();
-//                URI uri = new URI(bundleLocation);
-//                while(!"file".equalsIgnoreCase(uri.getScheme()) && uri.getScheme() != null) {
-//                    uri = new URI(uri.getSchemeSpecificPart());
-//                }
-////            bundleLocation = bundleLocation.substring(bundleLocation.lastIndexOf("file://") + 7);
-//                b = new File(uri);
-//                boolean foundRepoString = false;
-//                while (!foundRepoString) {
-//                    foundRepoString = b.getPath().endsWith("repository");
-//                    b = b.getParentFile();
-//                }
-//            } catch (Throwable e) {
-//                e.printStackTrace();
-//                b = new File(".").getAbsoluteFile();
-//            }
-//            base = b;
-//            base = DirectoryUtils.getGeronimoInstallDirectory();
-//            if (base == null) {
-//                throw new IllegalArgumentException("Could not determine geronimo installation directory");
-//            }
         } else {
             base = new File(baseDirectory);
         }
@@ -144,6 +106,8 @@
         }
         String tmpDir = resolveServerPath(System.getProperty("java.io.tmpdir"));       
         System.setProperty("java.io.tmpdir", tmpDir);
+        
+        logEnvInfo();
     }
 
     public BasicServerInfo(String baseDirectory, String serverName) {
@@ -152,6 +116,8 @@
         this.baseURI = base.toURI();
         this.baseServerURI = baseURI.resolve(serverName);
         this.baseServer = new File(baseServerURI);
+        
+        logEnvInfo();
     }
 
     /**
@@ -260,4 +226,37 @@
         return baseServerDir;
     }
     
+    private void logEnvInfo() {
+        try {
+           LOG.info("Runtime Information:");
+           LOG.info("  Install directory = " + base);
+           LOG.info("  Server directory  = " + baseServer);
+           LOG.info("  JVM in use        = " + JvmVendor.getJvmInfo());
+           LOG.info("Java Information:");
+           LOG.info("  System property [java.runtime.name]     = " + System.getProperty("java.runtime.name"));
+           LOG.info("  System property [java.runtime.version]  = " + System.getProperty("java.runtime.version"));
+           LOG.info("  System property [os.name]               = " + System.getProperty("os.name"));
+           LOG.info("  System property [os.version]            = " + System.getProperty("os.version"));
+           LOG.info("  System property [sun.os.patch.level]    = " + System.getProperty("sun.os.patch.level"));
+           LOG.info("  System property [os.arch]               = " + System.getProperty("os.arch"));
+           LOG.info("  System property [java.class.version]    = " + System.getProperty("java.class.version"));
+           LOG.info("  System property [locale]                = " + System.getProperty("user.language") + "_" + System.getProperty("user.country"));
+           LOG.info("  System property [unicode.encoding]      = " + System.getProperty("sun.io.unicode.encoding"));
+           LOG.info("  System property [file.encoding]         = " + System.getProperty("file.encoding"));
+           LOG.info("  System property [java.vm.name]          = " + System.getProperty("java.vm.name"));
+           LOG.info("  System property [java.vm.vendor]        = " + System.getProperty("java.vm.vendor"));
+           LOG.info("  System property [java.vm.version]       = " + System.getProperty("java.vm.version"));
+           LOG.info("  System property [java.vm.info]          = " + System.getProperty("java.vm.info"));
+           LOG.info("  System property [java.home]             = " + System.getProperty("java.home"));
+           LOG.info("  System property [java.classpath]        = " + System.getProperty("java.classpath"));
+           LOG.info("  System property [java.library.path]     = " + System.getProperty("java.library.path"));
+           LOG.info("  System property [java.endorsed.dirs]    = " + System.getProperty("java.endorsed.dirs"));
+           LOG.info("  System property [java.ext.dirs]         = " + System.getProperty("java.ext.dirs"));
+           LOG.info("  System property [sun.boot.class.path]   = " + System.getProperty("sun.boot.class.path"));
+           LOG.info("----------------------------------------------");
+        } catch (Exception e) {
+           System.err.println("Exception caught during logging of Runtime Information.  Exception=" + e.toString());
+        }
+     }
+    
 }

Modified: geronimo/server/trunk/framework/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/pom.xml?rev=835085&r1=835084&r2=835085&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/pom.xml Wed Nov 11 21:54:40 2009
@@ -42,7 +42,7 @@
         <module>geronimo-main</module>
         <module>geronimo-rmi-loader</module>
         <module>geronimo-system</module>
-        <!--<module>geronimo-logging</module>-->
+        <module>geronimo-pax-logging</module>
         <module>geronimo-kernel</module>
         <module>geronimo-plugin</module>
         <module>geronimo-deploy-tool</module>
@@ -62,7 +62,7 @@
                 <module>geronimo-main</module>
                 <module>geronimo-rmi-loader</module>
                 <module>geronimo-system</module>
-                <!--<module>geronimo-logging</module>-->
+                <module>geronimo-pax-logging</module>
                 <module>geronimo-kernel</module>
                 <module>geronimo-plugin</module>
                 <module>geronimo-deploy-tool</module>
@@ -105,7 +105,7 @@
                 <module>geronimo-main</module>
                 <module>geronimo-rmi-loader</module>
                 <module>geronimo-system</module>
-                <!--<module>geronimo-logging</module>-->
+                <module>geronimo-pax-logging</module>
                 <module>geronimo-kernel</module>
                 <module>geronimo-plugin</module>
                 <module>geronimo-deploy-tool</module>



Mime
View raw message