qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1689880 - in /qpid/java/trunk: ./ bdbstore/bin/ bdbstore/src/main/resources/ broker-core/src/main/java/org/apache/qpid/server/ broker-core/src/main/java/org/apache/qpid/server/logging/log4j/ broker-core/src/main/java/org/apache/qpid/server...
Date Wed, 08 Jul 2015 14:20:01 GMT
Author: orudyy
Date: Wed Jul  8 14:20:01 2015
New Revision: 1689880

URL: http://svn.apache.org/r1689880
Log:
QPID-6613: Avoid undesired logging sent to system output
           Upgraded logback version to 1.1.3 (to take advantage of Configurator service)

Added:
    qpid/java/trunk/bdbstore/src/main/resources/backup-logback.xml
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/logback/NoopConfigurator.java
      - copied, changed from r1689876, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
    qpid/java/trunk/broker-core/src/main/resources/META-INF/
    qpid/java/trunk/broker-core/src/main/resources/META-INF/services/
    qpid/java/trunk/broker-core/src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator
  (contents, props changed)
      - copied, changed from r1689876, qpid/java/trunk/bdbstore/bin/backup.sh
Removed:
    qpid/java/trunk/bdbstore/src/main/resources/backup-log4j.xml
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingManagementFacade.java
Modified:
    qpid/java/trunk/bdbstore/bin/backup.sh
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/Broker.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerTest.java
    qpid/java/trunk/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementPluginImpl.java
    qpid/java/trunk/pom.xml
    qpid/java/trunk/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java

Modified: qpid/java/trunk/bdbstore/bin/backup.sh
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/bin/backup.sh?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/bin/backup.sh (original)
+++ qpid/java/trunk/bdbstore/bin/backup.sh Wed Jul  8 14:20:01 2015
@@ -38,4 +38,4 @@ fi
 LIBS="${QPID_HOME}/lib/*:${QPID_HOME}/lib/plugins/*:${QPID_HOME}/lib/opt/*"
 
 echo "Starting Hot Backup Script"
-java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBBackup
"${ARGS[@]}"
+java -Dlogback.configurationFile=backup-logback.xml ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBBackup
"${ARGS[@]}"

Added: qpid/java/trunk/bdbstore/src/main/resources/backup-logback.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/resources/backup-logback.xml?rev=1689880&view=auto
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/resources/backup-logback.xml (added)
+++ qpid/java/trunk/bdbstore/src/main/resources/backup-logback.xml Wed Jul  8 14:20:01 2015
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+    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.
+-->
+<configuration scan="true" scanPeriod="10 seconds">
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <target>System.out</target>
+        <encoder>
+            <pattern>%m%n</pattern>
+        </encoder>
+    </appender>
+
+
+    <root level="info">
+        <appender-ref ref="CONSOLE"/>
+    </root>
+</configuration>

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/Broker.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/Broker.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/Broker.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/Broker.java Wed Jul 
8 14:20:01 2015
@@ -63,13 +63,12 @@ public class Broker
 
     private volatile Thread _shutdownHookThread;
     private EventLogger _eventLogger;
-    private boolean _configuringOwnLogging = false;
     private final TaskExecutor _taskExecutor = new TaskExecutorImpl();
 
     private volatile SystemConfig _systemConfig;
 
     private final Action<Integer> _shutdownAction;
-    private boolean _loggerContextStarted;
+    private volatile boolean _loggerContextStarted;
 
 
     public Broker()
@@ -82,16 +81,6 @@ public class Broker
         _shutdownAction = shutdownAction;
     }
 
-    protected static class InitException extends RuntimeException
-    {
-        private static final long serialVersionUID = 1L;
-
-        InitException(String msg, Throwable cause)
-        {
-            super(msg, cause);
-        }
-    }
-
     public void shutdown()
     {
         shutdown(0);
@@ -129,13 +118,10 @@ public class Broker
     {
         _taskExecutor.stop();
 
-        if (_configuringOwnLogging)
+        LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
+        if (_loggerContextStarted)
         {
-            LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
-            if (_loggerContextStarted)
-            {
-                loggerContext.stop();
-            }
+            loggerContext.stop();
         }
 
         if (_shutdownAction != null)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/BrokerOptions.java Wed
Jul  8 14:20:01 2015
@@ -70,7 +70,6 @@ public class BrokerOptions
     private int _managementModeJmxPortOverride;
     private int _managementModeHttpPortOverride;
     private String _managementModePassword;
-    private boolean _skipLoggingConfiguration;
     private boolean _overwriteConfigurationStore;
     private Map<String, String> _configProperties = new HashMap<String,String>();
     private boolean _startupLoggedToSystemOut = true;
@@ -256,16 +255,6 @@ public class BrokerOptions
         _initialConfigurationLocation = initialConfigurationLocation;
     }
 
-    public boolean isSkipLoggingConfiguration()
-    {
-        return _skipLoggingConfiguration;
-    }
-
-    public void setSkipLoggingConfiguration(boolean skipLoggingConfiguration)
-    {
-        _skipLoggingConfiguration = skipLoggingConfiguration;
-    }
-
     /**
      * Sets the named configuration property to the given value.
      *

Copied: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/logback/NoopConfigurator.java
(from r1689876, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/logback/NoopConfigurator.java?p2=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/logback/NoopConfigurator.java&p1=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java&r1=1689876&r2=1689880&rev=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/log4j/LoggingFacadeException.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/logback/NoopConfigurator.java
Wed Jul  8 14:20:01 2015
@@ -1,4 +1,5 @@
 /*
+ *
  * 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
@@ -17,29 +18,17 @@
  * under the License.
  *
  */
-package org.apache.qpid.server.logging.log4j;
+package org.apache.qpid.server.logging.logback;
 
-public class LoggingFacadeException extends Exception
-{
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.Configurator;
+import ch.qos.logback.core.spi.ContextAwareBase;
 
-    public LoggingFacadeException()
-    {
-        super();
-    }
-
-    public LoggingFacadeException(String message, Throwable cause)
-    {
-        super(message, cause);
-    }
-
-    public LoggingFacadeException(String message)
-    {
-        super(message);
-    }
-
-    public LoggingFacadeException(Throwable cause)
+public class NoopConfigurator extends ContextAwareBase implements Configurator
+{
+    @Override
+    public void configure(LoggerContext loggerContext)
     {
-        super(cause);
+        // no-op
     }
-
 }

Copied: qpid/java/trunk/broker-core/src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator
(from r1689876, qpid/java/trunk/bdbstore/bin/backup.sh)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator?p2=qpid/java/trunk/broker-core/src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator&p1=qpid/java/trunk/bdbstore/bin/backup.sh&r1=1689876&r2=1689880&rev=1689880&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/bin/backup.sh (original)
+++ qpid/java/trunk/broker-core/src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator
Wed Jul  8 14:20:01 2015
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -18,24 +17,4 @@
 # under the License.
 #
 
-# Parse arguments taking all - prefixed args as JAVA_OPTS
-
-declare -a ARGS
-for arg in "$@"; do
-    if [[ $arg == -java:* ]]; then
-        JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2`  "
-    else
-        ARGS[${#ARGS[@]}]="$arg"
-    fi
-done
-
-if [ -z "${QPID_HOME}" ]; then
-    WHEREAMI=`dirname "$0"`
-    export QPID_HOME=`cd ${WHEREAMI}/../ && pwd`
-fi
-
-# BDB's je JAR expected to be found in lib/opt
-LIBS="${QPID_HOME}/lib/*:${QPID_HOME}/lib/plugins/*:${QPID_HOME}/lib/opt/*"
-
-echo "Starting Hot Backup Script"
-java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBBackup
"${ARGS[@]}"
+org.apache.qpid.server.logging.logback.NoopConfigurator

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
Wed Jul  8 14:20:01 2015
@@ -150,17 +150,6 @@ public class BrokerOptionsTest extends Q
         assertEquals(5555, _options.getManagementModeHttpPortOverride());
     }
 
-    public void testDefaultSkipLoggingConfiguration()
-    {
-        assertFalse(_options.isSkipLoggingConfiguration());
-    }
-
-    public void testOverriddenSkipLoggingConfiguration()
-    {
-        _options.setSkipLoggingConfiguration(true);
-        assertTrue(_options.isSkipLoggingConfiguration());
-    }
-
     public void testDefaultOverwriteConfigurationStore()
     {
         assertFalse(_options.isOverwriteConfigurationStore());

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerTest.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerTest.java (original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/BrokerTest.java Wed Jul
 8 14:20:01 2015
@@ -90,7 +90,6 @@ public class BrokerTest extends QpidTest
     {
         BrokerOptions options = new BrokerOptions();
         options.setInitialSystemProperties(_initialSystemProperties.getAbsolutePath());
-        options.setSkipLoggingConfiguration(true);
         options.setStartupLoggedToSystemOut(true);
         options.setInitialConfigurationLocation(_initialConfiguration.getAbsolutePath());
         _broker = new Broker();

Modified: qpid/java/trunk/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementPluginImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementPluginImpl.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementPluginImpl.java
(original)
+++ qpid/java/trunk/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagementPluginImpl.java
Wed Jul  8 14:20:01 2015
@@ -35,7 +35,6 @@ import javax.management.JMException;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.apache.qpid.server.logging.BrokerFileLogger;
-import org.apache.qpid.server.logging.log4j.LoggingManagementFacade;
 import org.apache.qpid.server.model.BrokerLogger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: qpid/java/trunk/pom.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/pom.xml?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/pom.xml (original)
+++ qpid/java/trunk/pom.xml Wed Jul  8 14:20:01 2015
@@ -79,7 +79,7 @@
     <at.sign>@</at.sign>
     <bdb-version>5.0.104</bdb-version>
     <derby-version>10.11.1.1</derby-version>
-    <logback-version>1.1.2</logback-version>
+    <logback-version>1.1.3</logback-version>
     <guava-version>18.0</guava-version>
     <fasterxml-jackson-version>2.5.0</fasterxml-jackson-version>
 

Modified: qpid/java/trunk/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=1689880&r1=1689879&r2=1689880&view=diff
==============================================================================
--- qpid/java/trunk/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
(original)
+++ qpid/java/trunk/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
Wed Jul  8 14:20:01 2015
@@ -176,7 +176,7 @@ public class QpidTestCase extends TestCa
 
     protected String getClassQualifiedTestName()
     {
-        return getClass().getCanonicalName() + "-" + getName();
+        return getClass().getCanonicalName() + "." + getName();
     }
 
     protected String getTestName()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message