tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r881730 - in /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util: Logger.java PaxLogStreamFactory.java
Date Wed, 18 Nov 2009 11:35:55 GMT
Author: rickmcguire
Date: Wed Nov 18 11:35:55 2009
New Revision: 881730

URL: http://svn.apache.org/viewvc?rev=881730&view=rev
Log:
OPENEJB-1111 Openejb Logging does not interact well with PAX logging. 

Added:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
  (with props)
Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java?rev=881730&r1=881729&r2=881730&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/Logger.java
Wed Nov 18 11:35:55 2009
@@ -41,7 +41,7 @@
                 }
             }
 
-            if (factoryClass != null) {
+            if (factoryClass == null) {
                 try {
                     factoryClass = Class.forName(factoryName);
                 } catch (ClassNotFoundException e) {
@@ -186,7 +186,7 @@
      */
     private String formatMessage(String message, Object... args) {
         if (args.length == 0) return message;
-        
+
         try {
             MessageFormat mf = messageFormatCache.compute(message);
             String msg = mf.format(args);

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java?rev=881730&view=auto
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
(added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
Wed Nov 18 11:35:55 2009
@@ -0,0 +1,36 @@
+/**
+ *
+ * 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.openejb.util;
+
+/**
+ * A PAX logging friendly version of the log4j stream factory.
+ * This version assumes there is an external environment configured
+ * and avoids any NoClassDefFound errors that can occur
+ * with the full Log4jLogStreamFactory class when using the
+ * PAX API subset.
+ */
+public class PaxLogStreamFactory implements LogStreamFactory {
+
+    public LogStream createLogStream(LogCategory logCategory) {
+        return new Log4jLogStream(logCategory);
+    }
+
+    public PaxLogStreamFactory() {
+    }
+}
+

Propchange: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PaxLogStreamFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message