felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r939711 - in /felix/trunk/karaf: ./ assembly/ assembly/src/main/descriptors/ assembly/src/main/distribution/text/etc/ exception/ exception/src/ exception/src/main/ exception/src/main/java/ exception/src/main/java/java/ exception/src/main/ja...
Date Fri, 30 Apr 2010 15:27:06 GMT
Author: gnodet
Date: Fri Apr 30 15:27:06 2010
New Revision: 939711

URL: http://svn.apache.org/viewvc?rev=939711&view=rev
Log:
FELIX-2314: Improve logging support

Added:
    felix/trunk/karaf/exception/
    felix/trunk/karaf/exception/pom.xml
    felix/trunk/karaf/exception/src/
    felix/trunk/karaf/exception/src/main/
    felix/trunk/karaf/exception/src/main/java/
    felix/trunk/karaf/exception/src/main/java/java/
    felix/trunk/karaf/exception/src/main/java/java/lang/
    felix/trunk/karaf/exception/src/main/java/java/lang/Exception.java
Modified:
    felix/trunk/karaf/assembly/pom.xml
    felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml
    felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml
    felix/trunk/karaf/assembly/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg
    felix/trunk/karaf/pom.xml

Modified: felix/trunk/karaf/assembly/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/pom.xml?rev=939711&r1=939710&r2=939711&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/pom.xml (original)
+++ felix/trunk/karaf/assembly/pom.xml Fri Apr 30 15:27:06 2010
@@ -53,6 +53,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.felix.karaf</groupId>
+            <artifactId>org.apache.felix.karaf.exception</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix.karaf</groupId>
             <artifactId>org.apache.felix.karaf.client</artifactId>
         </dependency>
         <dependency>

Modified: felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml?rev=939711&r1=939710&r2=939711&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml (original)
+++ felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml Fri Apr 30 15:27:06 2010
@@ -128,6 +128,14 @@
     </files>
 
     <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib/endorsed</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
+            <includes>
+                <include>org.apache.felix.karaf:org.apache.felix.karaf.exception</include>
+            </includes>
+        </dependencySet>
 
         <dependencySet>
             <outputDirectory>/system</outputDirectory>

Modified: felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml?rev=939711&r1=939710&r2=939711&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml (original)
+++ felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml Fri Apr 30 15:27:06 2010
@@ -120,6 +120,14 @@
     </files>
 
     <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib/endorsed</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
+            <includes>
+                <include>org.apache.felix.karaf:org.apache.felix.karaf.exception</include>
+            </includes>
+        </dependencySet>
 
         <dependencySet>
             <outputDirectory>/system</outputDirectory>

Modified: felix/trunk/karaf/assembly/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg?rev=939711&r1=939710&r2=939711&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg (original)
+++ felix/trunk/karaf/assembly/src/main/distribution/text/etc/org.ops4j.pax.logging.cfg Fri
Apr 30 15:27:06 2010
@@ -19,15 +19,27 @@
 
 # Root logger
 log4j.rootLogger=INFO, out, osgi:VmLogAppender
+log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer
 
 # CONSOLE appender not used by default
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %m%n
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
 
 # File appender
 log4j.appender.out=org.apache.log4j.FileAppender
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %m%n
+log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1}
| %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
 log4j.appender.out.file=${karaf.base}/data/log/karaf.log
 log4j.appender.out.append=true
+
+# Sift appender
+log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
+log4j.appender.sift.key=bundle.name
+log4j.appender.sift.default=karaf
+log4j.appender.sift.appender=org.apache.log4j.FileAppender
+log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
+log4j.appender.sift.appender.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t |
%-32.32c{1} | %-32.32C %4L | %m%n
+log4j.appender.sift.appender.file=${karaf.base}/data/log/$\\{bundle.name\\}.log
+log4j.appender.sift.appender.append=true
+

Added: felix/trunk/karaf/exception/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/exception/pom.xml?rev=939711&view=auto
==============================================================================
--- felix/trunk/karaf/exception/pom.xml (added)
+++ felix/trunk/karaf/exception/pom.xml Fri Apr 30 15:27:06 2010
@@ -0,0 +1,38 @@
+<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.felix.karaf</groupId>
+        <artifactId>karaf</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.felix.karaf</groupId>
+    <artifactId>org.apache.felix.karaf.exception</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <name>Apache Felix Karaf :: Exception</name>
+
+    <properties>
+        <appendedResourcesDirectory>${basedir}/../etc/appended-resources</appendedResourcesDirectory>
+    </properties>
+
+</project>

Added: felix/trunk/karaf/exception/src/main/java/java/lang/Exception.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/exception/src/main/java/java/lang/Exception.java?rev=939711&view=auto
==============================================================================
--- felix/trunk/karaf/exception/src/main/java/java/lang/Exception.java (added)
+++ felix/trunk/karaf/exception/src/main/java/java/lang/Exception.java Fri Apr 30 15:27:06
2010
@@ -0,0 +1,109 @@
+/*
+ *  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 java.lang;
+
+
+/**
+ * {@code Exception} is the superclass of all classes that represent recoverable
+ * exceptions. When exceptions are thrown, they may be caught by application
+ * code.
+ *
+ * @see Throwable
+ * @see Error
+ * @see RuntimeException
+ */
+public class Exception extends Throwable {
+    private static final long serialVersionUID = -3387516993124229948L;
+
+    private transient Class[] classContext = sm.getThrowableContext(this);
+
+    /**
+     * Constructs a new {@code Exception} that includes the current stack trace.
+     */
+    public Exception() {
+        super();
+    }
+
+    /**
+     * Constructs a new {@code Exception} with the current stack trace and the
+     * specified detail message.
+     *
+     * @param detailMessage
+     *            the detail message for this exception.
+     */
+    public Exception(String detailMessage) {
+        super(detailMessage);
+    }
+
+    /**
+     * Constructs a new {@code Exception} with the current stack trace, the
+     * specified detail message and the specified cause.
+     *
+     * @param detailMessage
+     *            the detail message for this exception.
+     * @param throwable
+     *            the cause of this exception.
+     */
+    public Exception(String detailMessage, Throwable throwable) {
+        super(detailMessage, throwable);
+    }
+
+    /**
+     * Constructs a new {@code Exception} with the current stack trace and the
+     * specified cause.
+     *
+     * @param throwable
+     *            the cause of this exception.
+     */
+    public Exception(Throwable throwable) {
+        super(throwable);
+    }
+
+    public Class[] getClassContext() {
+        return classContext;
+    }
+
+    private static final SecurityManagerEx sm = new SecurityManagerEx();
+
+    static class SecurityManagerEx extends SecurityManager
+    {
+        public Class[] getClassContext()
+        {
+            return super.getClassContext();
+        }
+
+        public Class[] getThrowableContext(Throwable t) {
+            try {
+                Class[] context = getClassContext();
+                int nb = 0;
+                for (;;) {
+                    if (context[context.length - 1 - nb] == t.getClass()) {
+                        break;
+                    }
+                    nb++;
+                }
+                Class[] nc = new Class[nb];
+                System.arraycopy(context, context.length - nb, nc, 0, nb);
+                return nc;
+            } catch (Exception e) {
+                return null;
+            }
+        }
+    }
+
+}
\ No newline at end of file

Modified: felix/trunk/karaf/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/pom.xml?rev=939711&r1=939710&r2=939711&view=diff
==============================================================================
--- felix/trunk/karaf/pom.xml (original)
+++ felix/trunk/karaf/pom.xml Fri Apr 30 15:27:06 2010
@@ -45,6 +45,7 @@
         <module>management</module>
         <module>webconsole</module>
         <module>manual</module>
+        <module>exception</module>
         <module>assembly</module>
         <module>demos</module>
         <module>itests</module>
@@ -91,11 +92,11 @@
         <jetty.bundle.version>6.1.22_1</jetty.bundle.version>
         <junit.version>4.7_1</junit.version>
         <jline.version>0.9.95.20100209</jline.version>
-        <log4j.version>1.2.14</log4j.version>
+        <log4j.version>1.2.16</log4j.version>
         <maven.version>2.0.9</maven.version>
         <mina.version>2.0.0-RC1</mina.version>
         <pax.exam.version>1.1.0</pax.exam.version>
-        <pax.logging.version>1.4</pax.logging.version>
+        <pax.logging.version>1.4.1-SNAPSHOT</pax.logging.version>
         <pax.runner.version>1.2.1</pax.runner.version>
         <pax.url.version>1.1.2</pax.url.version>
         <pax.web.version>0.7.2</pax.web.version>
@@ -168,6 +169,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.felix.karaf</groupId>
+                <artifactId>org.apache.felix.karaf.exception</artifactId>
+                <version>${pom.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.felix.karaf</groupId>
                 <artifactId>org.apache.felix.karaf.client</artifactId>
                 <version>${pom.version}</version>
             </dependency>



Mime
View raw message