qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1678105 [1/3] - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ broker-codegen/src/main/java/org/apache/qpid/server/model/ broker-co...
Date Wed, 06 May 2015 22:28:50 GMT
Author: rgodfrey
Date: Wed May  6 22:28:49 2015
New Revision: 1678105

URL: http://svn.apache.org/r1678105
Log:
QPID-6533 : Store logging configuration within the broker config

Added:
    qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LoggingMessageLogger.java
      - copied, changed from r1678104, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLogger.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerLoggerFilter.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModule.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValue.java   (with props)
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueType.java   (with props)
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/ConfiguredObjectJacksonModuleTest.java   (with props)
Removed:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java
Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBSystemConfigImpl.java
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ConfiguredObjectBinding.java
    qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/SystemConfigFactoryGenerator.java
    qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java
    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/logging/LogRecorder.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerModel.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectAttributeOrStatistic.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/JsonSystemConfigImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/SystemConfig.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/plugin/SystemConfigFactory.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/stats/StatisticsCounter.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCConfigurationStore.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecoverer.java
    qpid/java/trunk/broker-core/src/main/resources/initial-config.json
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerRecovererTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java
    qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfigImpl.java
    qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfigImpl.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/LogRecordsServlet.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
    qpid/java/trunk/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemorySystemConfigImpl.java
    qpid/java/trunk/broker/etc/logback.xml
    qpid/java/trunk/systests/etc/config-systests.json
    qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
    qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/client/AsynchMessageListenerTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/BrokerStartupTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AbstractTestLogging.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/AlertingTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBSystemConfigImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBSystemConfigImpl.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBSystemConfigImpl.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBSystemConfigImpl.java Wed May  6 22:28:49 2015
@@ -48,10 +48,9 @@ public class BDBSystemConfigImpl extends
     @SystemConfigFactoryConstructor
     public BDBSystemConfigImpl(final TaskExecutor taskExecutor,
                                final EventLogger eventLogger,
-                               final LogRecorder logRecorder,
-                               final Map<String,Object> attributes)
+                               final Map<String, Object> attributes)
     {
-        super(taskExecutor, eventLogger, logRecorder, attributes);
+        super(taskExecutor, eventLogger, attributes);
     }
 
     @Override

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ConfiguredObjectBinding.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ConfiguredObjectBinding.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ConfiguredObjectBinding.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/tuple/ConfiguredObjectBinding.java Wed May  6 22:28:49 2015
@@ -25,7 +25,7 @@ import java.io.StringWriter;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.ConfiguredObjectJacksonModule;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
 
 import com.sleepycat.bind.tuple.TupleBinding;
@@ -33,16 +33,8 @@ import com.sleepycat.bind.tuple.TupleInp
 import com.sleepycat.bind.tuple.TupleOutput;
 import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.server.store.berkeleydb.BDBConfiguredObjectRecord;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.Module;
+
 import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializerProvider;
-import org.codehaus.jackson.map.module.SimpleModule;
 
 public class ConfiguredObjectBinding extends TupleBinding<ConfiguredObjectRecord>
 {
@@ -50,27 +42,6 @@ public class ConfiguredObjectBinding ext
 
     private final UUID _uuid;
 
-    private static final Module _module;
-    static
-    {
-        SimpleModule module= new SimpleModule("ConfiguredObjectSerializer", new Version(1,0,0,null));
-
-        final JsonSerializer<ConfiguredObject> serializer = new JsonSerializer<ConfiguredObject>()
-        {
-            @Override
-            public void serialize(final ConfiguredObject value,
-                                  final JsonGenerator jgen,
-                                  final SerializerProvider provider)
-                    throws IOException, JsonProcessingException
-            {
-                jgen.writeString(value.getId().toString());
-            }
-        };
-        module.addSerializer(ConfiguredObject.class, serializer);
-
-        _module = module;
-    }
-
     public static ConfiguredObjectBinding getInstance()
     {
         return INSTANCE;
@@ -105,20 +76,11 @@ public class ConfiguredObjectBinding ext
         try
         {
             StringWriter writer = new StringWriter();
-            final ObjectMapper objectMapper = new ObjectMapper();
-            objectMapper.registerModule(_module);
+            final ObjectMapper objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
             objectMapper.writeValue(writer, object.getAttributes());
             tupleOutput.writeString(object.getType());
             tupleOutput.writeString(writer.toString());
         }
-        catch (JsonMappingException e)
-        {
-            throw new StoreException(e);
-        }
-        catch (JsonGenerationException e)
-        {
-            throw new StoreException(e);
-        }
         catch (IOException e)
         {
             throw new StoreException(e);

Modified: qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/SystemConfigFactoryGenerator.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/SystemConfigFactoryGenerator.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/SystemConfigFactoryGenerator.java (original)
+++ qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/SystemConfigFactoryGenerator.java Wed May  6 22:28:49 2015
@@ -117,7 +117,6 @@ public class SystemConfigFactoryGenerato
             pw.println();
             pw.println("import org.apache.qpid.server.configuration.updater.TaskExecutor;");
             pw.println("import org.apache.qpid.server.logging.EventLogger;");
-            pw.println("import org.apache.qpid.server.logging.LogRecorder;");
             pw.println("import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry;");
             pw.println("import org.apache.qpid.server.model.SystemConfig;");
             pw.println("import org.apache.qpid.server.plugin.PluggableService;");
@@ -139,10 +138,9 @@ public class SystemConfigFactoryGenerato
             pw.println("    @Override");
             pw.println("    public "+objectSimpleName+" newInstance(final TaskExecutor taskExecutor,");
             pw.println("                       final EventLogger eventLogger,");
-            pw.println("                       final LogRecorder logRecorder,");
             pw.println("                       final Map<String,Object> attributes)");
             pw.println("    {");
-            pw.println("        return new "+objectSimpleName+"(taskExecutor, eventLogger, logRecorder, attributes);");
+            pw.println("        return new "+objectSimpleName+"(taskExecutor, eventLogger, attributes);");
             pw.println("    }");
             pw.println("}");
 

Modified: qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java (original)
+++ qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java Wed May  6 22:28:49 2015
@@ -26,9 +26,11 @@ import java.util.List;
 import java.util.Set;
 
 import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.ProcessingEnvironment;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
 import javax.lang.model.SourceVersion;
+import javax.lang.model.element.AnnotationMirror;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
@@ -54,6 +56,8 @@ public class AttributeAnnotationValidato
 
 
 
+
+
     private static final Set<TypeKind> VALID_PRIMITIVE_TYPES = new HashSet<>(Arrays.asList(TypeKind.BOOLEAN,
                                                                                            TypeKind.BYTE,
                                                                                            TypeKind.CHAR,
@@ -248,7 +252,13 @@ public class AttributeAnnotationValidato
         }
     }
 
-    private boolean isValidType(final TypeMirror type)
+    boolean isValidType(final TypeMirror type)
+    {
+        return isValidType(processingEnv, type);
+    }
+
+    static boolean isValidType(ProcessingEnvironment processingEnv,
+                               final TypeMirror type)
     {
         Types typeUtils = processingEnv.getTypeUtils();
         Elements elementUtils = processingEnv.getElementUtils();
@@ -271,14 +281,22 @@ public class AttributeAnnotationValidato
         }
 
         String className = "org.apache.qpid.server.model.ConfiguredObject";
-        TypeMirror configuredObjectType = getErasure(className);
+        TypeMirror configuredObjectType = getErasure(processingEnv, className);
 
         if(typeUtils.isAssignable(typeUtils.erasure(type), configuredObjectType))
         {
             return true;
         }
 
-
+        final TypeElement managedAttributeTypeValueElement =
+                elementUtils.getTypeElement(ManagedAttributeValueTypeValidator.MANAGED_ATTRIBUTE_VALUE_TYPE_CLASS_NAME);
+        for(AnnotationMirror annotation : typeElement.getAnnotationMirrors())
+        {
+            if(annotation.getAnnotationType().asElement().equals(managedAttributeTypeValueElement))
+            {
+                return true;
+            }
+        }
         if(typeUtils.isSameType(type,elementUtils.getTypeElement("java.lang.Object").asType()))
         {
             return true;
@@ -297,16 +315,16 @@ public class AttributeAnnotationValidato
         }
 
         TypeMirror erasedType = typeUtils.erasure(type);
-        if(typeUtils.isSameType(erasedType, getErasure("java.util.List"))
-                || typeUtils.isSameType(erasedType, getErasure("java.util.Set"))
-                || typeUtils.isSameType(erasedType, getErasure("java.util.Collection")))
+        if(typeUtils.isSameType(erasedType, getErasure(processingEnv, "java.util.List"))
+                || typeUtils.isSameType(erasedType, getErasure(processingEnv, "java.util.Set"))
+                || typeUtils.isSameType(erasedType, getErasure(processingEnv, "java.util.Collection")))
         {
 
 
             for(TypeMirror paramType : ((DeclaredType)type).getTypeArguments())
             {
 
-                if(!isValidType(paramType))
+                if(!isValidType(processingEnv, paramType))
                 {
                     return false;
                 }
@@ -314,14 +332,16 @@ public class AttributeAnnotationValidato
             return true;
         }
 
-        if(typeUtils.isSameType(erasedType, getErasure("java.util.Map")))
+        if(typeUtils.isSameType(erasedType, getErasure(processingEnv, "java.util.Map")))
         {
             List<? extends TypeMirror> args = ((DeclaredType) type).getTypeArguments();
             if (args.size() != 2)
             {
                 throw new IllegalArgumentException("Map types " + type + " must have exactly two type arguments");
             }
-            return isValidType(args.get(0)) && (isValidType(args.get(1)) || typeUtils.isSameType(args.get(1), getErasure("java.lang.Object")));
+            return isValidType(processingEnv, args.get(0))
+                   && (isValidType(processingEnv, args.get(1))
+                       || typeUtils.isSameType(args.get(1), getErasure(processingEnv, "java.lang.Object")));
         }
 
 
@@ -330,6 +350,11 @@ public class AttributeAnnotationValidato
 
     private TypeMirror getErasure(final String className)
     {
+        return getErasure(processingEnv, className);
+    }
+
+    private static TypeMirror getErasure(ProcessingEnvironment processingEnv, final String className)
+    {
         final Types typeUtils = processingEnv.getTypeUtils();
         final Elements elementUtils = processingEnv.getElementUtils();
         return typeUtils.erasure(elementUtils.getTypeElement(className).asType());

Added: qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java (added)
+++ qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java Wed May  6 22:28:49 2015
@@ -0,0 +1,141 @@
+/*
+ *
+ * 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.qpid.server.model.validation;
+
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Name;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.Elements;
+import javax.tools.Diagnostic;
+
+@SupportedAnnotationTypes(ManagedAttributeValueTypeValidator.MANAGED_ATTRIBUTE_VALUE_TYPE_CLASS_NAME)
+public class ManagedAttributeValueTypeValidator extends AbstractProcessor
+{
+
+    public static final String MANAGED_ATTRIBUTE_VALUE_TYPE_CLASS_NAME =
+            "org.apache.qpid.server.model.ManagedAttributeValueType";
+
+    public static final String MANAGED_ATTRIBUTE_VALUE_CLASS_NAME =
+            "org.apache.qpid.server.model.ManagedAttributeValue";
+
+    @Override
+    public SourceVersion getSupportedSourceVersion()
+    {
+        return SourceVersion.latest();
+    }
+
+    @Override
+    public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv)
+    {
+        Elements elementUtils = processingEnv.getElementUtils();
+        TypeElement annotationElement = elementUtils.getTypeElement(MANAGED_ATTRIBUTE_VALUE_TYPE_CLASS_NAME);
+
+        for (Element e : roundEnv.getElementsAnnotatedWith(annotationElement))
+        {
+            checkAnnotationIsOnInterface(annotationElement, e);
+            checkAllMethodsAreAccessors(e);
+        }
+        return false;
+    }
+
+    private void checkAllMethodsAreAccessors(final Element e)
+    {
+        checkAllMethodsAreAccessors(e, new HashSet<Element>());
+    }
+
+    private void checkAllMethodsAreAccessors(final Element e, Set<Element> checked)
+    {
+
+        if(!checked.add(e))
+        {
+            return;
+        }
+
+        final Name annotationName = processingEnv.getElementUtils()
+                .getTypeElement(MANAGED_ATTRIBUTE_VALUE_TYPE_CLASS_NAME)
+                .getSimpleName();
+
+        for(Element memberElement : e.getEnclosedElements())
+        {
+            if(memberElement instanceof ExecutableElement)
+            {
+                final ExecutableElement methodElement = (ExecutableElement) memberElement;
+                AttributeAnnotationValidator.isValidType(processingEnv, methodElement.getReturnType());
+                String methodName = methodElement.getSimpleName().toString();
+
+                if (methodName.length() < 3
+                    || (methodName.length() < 4 && !methodName.startsWith("is"))
+                    || !(methodName.startsWith("is") || methodName.startsWith("get") || methodName.startsWith("has"))
+                    || !methodElement.getTypeParameters().isEmpty() )
+                {
+                    processingEnv.getMessager()
+                            .printMessage(Diagnostic.Kind.ERROR,
+                                          "Methods in an @" + annotationName
+                                          + " interface can only be applied to methods which of the form getXXX(), isXXX() or hasXXX()",
+                                          methodElement
+                                         );
+                }
+            }
+        }
+        final List<? extends TypeMirror> interfaces = ((TypeElement) e).getInterfaces();
+        for(TypeMirror mirror : interfaces)
+        {
+            checkAllMethodsAreAccessors(processingEnv.getTypeUtils().asElement(mirror), checked);
+        }
+    }
+
+    public void checkAnnotationIsOnInterface(final TypeElement annotationElement, final Element e)
+    {
+        if (e.getKind() != ElementKind.INTERFACE)
+        {
+            processingEnv.getMessager()
+                    .printMessage(Diagnostic.Kind.ERROR,
+                                  "@"
+                                  + annotationElement.getSimpleName()
+                                  + " can only be applied to an interface",
+                                  e
+                                 );
+        }
+        if(!processingEnv.getTypeUtils().isAssignable(e.asType(), processingEnv.getElementUtils().getTypeElement(MANAGED_ATTRIBUTE_VALUE_CLASS_NAME).asType()))
+        {
+            processingEnv.getMessager()
+                    .printMessage(Diagnostic.Kind.ERROR,
+                                  "@"
+                                  + annotationElement.getSimpleName()
+                                  + " can only be applied to an interface",
+                                  e
+                                 );
+        }
+    }
+
+}

Propchange: qpid/java/trunk/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/ManagedAttributeValueTypeValidator.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=1678105&r1=1678104&r2=1678105&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 May  6 22:28:49 2015
@@ -21,6 +21,7 @@
 package org.apache.qpid.server;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -32,12 +33,14 @@ import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import java.util.logging.LogManager;
 
 import javax.security.auth.Subject;
 
+import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.LoggerContext;
 import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.ConsoleAppender;
 import ch.qos.logback.core.joran.spi.JoranException;
 import ch.qos.logback.core.util.StatusPrinter;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -47,8 +50,7 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
 import org.apache.qpid.server.configuration.updater.TaskExecutorImpl;
 import org.apache.qpid.server.logging.EventLogger;
-import org.apache.qpid.server.logging.Log4jMessageLogger;
-import org.apache.qpid.server.logging.LogRecorder;
+import org.apache.qpid.server.logging.LoggingMessageLogger;
 import org.apache.qpid.server.logging.MessageLogger;
 import org.apache.qpid.server.logging.SystemOutMessageLogger;
 import org.apache.qpid.server.logging.log4j.LoggingManagementFacade;
@@ -175,29 +177,18 @@ public class Broker
         String storeLocation = options.getConfigurationStoreLocation();
         String storeType = options.getConfigurationStoreType();
 
-        if (options.isStartupLoggedToSystemOut())
-        {
-            _eventLogger.message(BrokerMessages.CONFIG(storeLocation));
-        }
-
-        //Allow skipping the logging configuration for people who are
-        //embedding the broker and want to configure it themselves.
-        if(!options.isSkipLoggingConfiguration())
-        {
-            configureLogging(new File(options.getLogConfigFileLocation()), options.isStartupLoggedToSystemOut());
-        }
         // Create the RootLogger to be used during broker operation
         boolean statusUpdatesEnabled = Boolean.parseBoolean(System.getProperty(BrokerProperties.PROPERTY_STATUS_UPDATES, "true"));
-        MessageLogger messageLogger = new Log4jMessageLogger(statusUpdatesEnabled);
-        _eventLogger.setMessageLogger(messageLogger);
 
-        // Additionally, report BRK-1006 and BRK-1007 into log4j appenders
-        if(!options.isSkipLoggingConfiguration())
-        {
-            _eventLogger.message(BrokerMessages.LOG_CONFIG(new File(options.getLogConfigFileLocation()).getAbsolutePath()));
-        }
+        ch.qos.logback.classic.Logger logger =
+                (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        logger.getLoggerContext().reset();
+        logger.setAdditive(true);
+        logger.setLevel(Level.INFO);
+
+        MessageLogger messageLogger = new LoggingMessageLogger(statusUpdatesEnabled);
+        _eventLogger.setMessageLogger(messageLogger);
 
-        _eventLogger.message(BrokerMessages.CONFIG(storeLocation));
 
         PluggableFactoryLoader<SystemConfigFactory> configFactoryLoader = new PluggableFactoryLoader<>(SystemConfigFactory.class);
         SystemConfigFactory configFactory = configFactoryLoader.get(storeType);
@@ -208,11 +199,8 @@ public class Broker
         }
 
 
-
-        LogRecorder logRecorder = new LogRecorder();
-
         _taskExecutor.start();
-        _systemConfig = configFactory.newInstance(_taskExecutor, _eventLogger, logRecorder, options.convertToSystemConfigAttributes());
+        _systemConfig = configFactory.newInstance(_taskExecutor, _eventLogger, options.convertToSystemConfigAttributes());
         try
         {
             _systemConfig.open();
@@ -251,58 +239,6 @@ public class Broker
         }
     }
 
-    private void configureLogging(File logConfigFile, boolean startupLoggedToSystemOutput) throws InitException, IOException
-    {
-        _configuringOwnLogging = true;
-        if (logConfigFile.exists() && logConfigFile.canRead())
-        {
-            if (startupLoggedToSystemOutput)
-            {
-                _eventLogger.message(BrokerMessages.LOG_CONFIG(logConfigFile.getAbsolutePath()));
-            }
-
-            try
-            {
-                LoggingManagementFacade.configure(logConfigFile.getPath());
-            }
-            catch (Exception e)
-            {
-                throw new InitException(e.getMessage(),e);
-            }
-        }
-        else
-        {
-            System.err.println("Logging configuration error: unable to read file " + logConfigFile.getAbsolutePath());
-            System.err.println("Using the fallback internal fallback-logback.xml configuration");
-
-            InputStream propsFile = this.getClass().getResourceAsStream("/fallback-logback.xml");
-            if(propsFile == null)
-            {
-                throw new IOException("Unable to load the fallback internal fallback-logback.xml configuration file");
-            }
-            else
-            {
-                LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
-                try
-                {
-                    JoranConfigurator configurator = new JoranConfigurator();
-                    configurator.setContext(context);
-                    context.reset();
-                    configurator.doConfigure(propsFile);
-                }
-                catch (JoranException e)
-                {
-                    // StatusPrinter will handle this
-                }
-                finally
-                {
-                    StatusPrinter.printInCaseOfErrorsOrWarnings(context);
-                    propsFile.close();
-                }
-            }
-        }
-    }
-
 
     private void addShutdownHook()
     {

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java Wed May  6 22:28:49 2015
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import org.apache.qpid.server.model.BrokerLogger;
+import org.apache.qpid.server.model.ManagedAttribute;
+import org.apache.qpid.server.model.ManagedObject;
+
+@ManagedObject( category = false, type = BrokerConsoleLogger.TYPE)
+public interface BrokerConsoleLogger<X extends BrokerConsoleLogger<X>> extends BrokerLogger<X>
+{
+    String TYPE = "Console";
+
+    @ManagedAttribute(defaultValue = "%d %-5p [%t] \\(%c{2}\\) - %m%n")
+    String getLayout();
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java Wed May  6 22:28:49 2015
@@ -0,0 +1,81 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import java.util.Map;
+
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.ConsoleAppender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.BrokerLoggerFilter;
+import org.apache.qpid.server.model.ManagedAttributeField;
+import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
+
+public class BrokerConsoleLoggerImpl extends AbstractConfiguredObject<BrokerConsoleLoggerImpl> implements BrokerConsoleLogger<BrokerConsoleLoggerImpl>
+{
+    @ManagedAttributeField
+    private String _layout;
+
+    @ManagedObjectFactoryConstructor
+    protected BrokerConsoleLoggerImpl(final Map<String, Object> attributes, Broker<?> broker)
+    {
+        super(parentsMap(broker),attributes);
+    }
+
+    @Override
+    public String getLayout()
+    {
+        return _layout;
+    }
+
+    @Override
+    public Appender<ILoggingEvent> asAppender()
+    {
+        ch.qos.logback.classic.Logger rootLogger =
+                (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+
+        final PatternLayoutEncoder encoder = new PatternLayoutEncoder();
+        encoder.setPattern(getLayout());
+        encoder.setContext(rootLogger.getLoggerContext());
+        encoder.start();
+
+        ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>();
+        consoleAppender.setContext(rootLogger.getLoggerContext());
+
+        for(BrokerLoggerFilter<?> filter : getChildren(BrokerLoggerFilter.class))
+        {
+            consoleAppender.addFilter(filter.asFilter());
+        }
+        consoleAppender.addFilter(DenyAllFilter.getInstance());
+        consoleAppender.setName(getName());
+
+        consoleAppender.setEncoder(encoder);
+        consoleAppender.start();
+
+        return consoleAppender;
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerConsoleLoggerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java Wed May  6 22:28:49 2015
@@ -0,0 +1,55 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import org.apache.qpid.server.model.BrokerLogger;
+import org.apache.qpid.server.model.ManagedAttribute;
+import org.apache.qpid.server.model.ManagedObject;
+
+@ManagedObject( category = false, type = BrokerFileLogger.TYPE)
+public interface BrokerFileLogger<X extends BrokerFileLogger<X>> extends BrokerLogger<X>
+{
+    String TYPE = "File";
+
+    @ManagedAttribute( defaultValue = "${qpid.work_dir}${file.separator}log${file.separator}qpid.log")
+    String getFileName();
+
+    @ManagedAttribute( defaultValue = "false")
+    boolean isRollDaily();
+
+    @ManagedAttribute( defaultValue = "false")
+    boolean isRollOnRestart();
+
+    @ManagedAttribute( defaultValue = "false")
+    boolean isCompressOldFiles();
+
+    @ManagedAttribute( defaultValue = "1")
+    int getMaxHistory();
+
+    @ManagedAttribute( defaultValue = "100mb")
+    String getMaxFileSize();
+
+    @ManagedAttribute( defaultValue = "false" )
+    boolean isSafeMode();
+
+    @ManagedAttribute(defaultValue = "%d %-5p [%t] \\(%c{2}\\) - %m%n")
+    String getLayout();
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java Wed May  6 22:28:49 2015
@@ -0,0 +1,258 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import java.io.File;
+import java.util.Map;
+
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.rolling.FixedWindowRollingPolicy;
+import ch.qos.logback.core.rolling.RollingFileAppender;
+import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP;
+import ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy;
+import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.BrokerLoggerFilter;
+import org.apache.qpid.server.model.ManagedAttributeField;
+import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
+
+public class BrokerFileLoggerImpl extends AbstractConfiguredObject<BrokerFileLoggerImpl> implements BrokerFileLogger<BrokerFileLoggerImpl>
+{
+    @ManagedAttributeField
+    private String _layout;
+    @ManagedAttributeField
+    private String _fileName;
+    @ManagedAttributeField
+    private boolean _rollDaily;
+    @ManagedAttributeField
+    private boolean _rollOnRestart;
+    @ManagedAttributeField
+    private boolean _compressOldFiles;
+    @ManagedAttributeField
+    private int _maxHistory;
+    @ManagedAttributeField
+    private String _maxFileSize;
+    @ManagedAttributeField
+    private boolean _safeMode;
+
+    @ManagedObjectFactoryConstructor
+    protected BrokerFileLoggerImpl(final Map<String, Object> attributes, Broker<?> broker)
+    {
+        super(parentsMap(broker),attributes);
+    }
+
+    @Override
+    public String getFileName()
+    {
+        return _fileName;
+    }
+
+    @Override
+    public boolean isRollDaily()
+    {
+        return _rollDaily;
+    }
+
+    @Override
+    public boolean isRollOnRestart()
+    {
+        return _rollOnRestart;
+    }
+
+    @Override
+    public boolean isCompressOldFiles()
+    {
+        return _compressOldFiles;
+    }
+
+    @Override
+    public int getMaxHistory()
+    {
+        return _maxHistory;
+    }
+
+    @Override
+    public String getMaxFileSize()
+    {
+        return _maxFileSize;
+    }
+
+    @Override
+    public boolean isSafeMode()
+    {
+        return _safeMode;
+    }
+
+    @Override
+    public String getLayout()
+    {
+        return _layout;
+    }
+
+    @Override
+    public Appender<ILoggingEvent> asAppender()
+    {
+        ch.qos.logback.classic.Logger rootLogger =
+                (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        LoggerContext loggerContext = rootLogger.getLoggerContext();
+        RollingFileAppender<ILoggingEvent> appender = new RollingFileAppender<>();
+        appender.setFile(getFileName());
+        appender.setAppend(true);
+        appender.setContext(loggerContext);
+
+        for(BrokerLoggerFilter<?> filter : getChildren(BrokerLoggerFilter.class))
+        {
+            appender.addFilter(filter.asFilter());
+        }
+        appender.addFilter(DenyAllFilter.getInstance());
+        appender.setName(getName());
+
+        if(isRollDaily())
+        {
+            DailyTriggeringPolicy triggeringPolicy = new DailyTriggeringPolicy();
+            triggeringPolicy.setContext(loggerContext);
+            TimeBasedRollingPolicy<ILoggingEvent> rollingPolicy = new TimeBasedRollingPolicy<>();
+            rollingPolicy.setContext(loggerContext);
+            rollingPolicy.setMaxHistory(getMaxHistory());
+            rollingPolicy.setTimeBasedFileNamingAndTriggeringPolicy(triggeringPolicy);
+            rollingPolicy.setFileNamePattern(getFileName() + ".%d{yyyy-MM-dd}.%i" + (isCompressOldFiles()
+                    ? ".gz"
+                    : ""));
+            appender.setRollingPolicy(rollingPolicy);
+            rollingPolicy.setParent(appender);
+            rollingPolicy.start();
+        }
+        else
+        {
+            SizeTriggeringPolicy sizeTriggeringPolicy = new SizeTriggeringPolicy();
+            sizeTriggeringPolicy.setContext(loggerContext);
+            SimpleRollingPolicy rollingPolicy = new SimpleRollingPolicy();
+            rollingPolicy.setContext(loggerContext);
+            rollingPolicy.setFileNamePattern(getFileName() + ".%i" + (isCompressOldFiles() ? ".gz" : ""));
+            appender.setRollingPolicy(rollingPolicy);
+            appender.setTriggeringPolicy(sizeTriggeringPolicy);
+            rollingPolicy.setParent(appender);
+            rollingPolicy.start();
+            sizeTriggeringPolicy.start();
+        }
+        final PatternLayoutEncoder encoder = new PatternLayoutEncoder();
+        encoder.setPattern("%d %-5p [%t] \\(%c{2}\\) - %m%n");
+        encoder.setContext(loggerContext);
+        encoder.start();
+        appender.setEncoder(encoder);
+        appender.start();
+        return appender;
+    }
+
+    private class DailyTriggeringPolicy extends SizeAndTimeBasedFNATP<ILoggingEvent>
+    {
+        private final boolean _rollOnRestart;
+        private boolean _isFirst = true;
+
+        public DailyTriggeringPolicy()
+        {
+            _rollOnRestart = isRollOnRestart();
+            setMaxFileSize(getMaxFileSize());
+
+        }
+
+        @Override
+        protected void computeNextCheck()
+        {
+            super.computeNextCheck();
+            if (_rollOnRestart && _isFirst)
+            {
+                _isFirst = false;
+                nextCheck = 0l;
+            }
+        }
+
+        @Override
+        public boolean isTriggeringEvent(final File activeFile, final ILoggingEvent event)
+        {
+            if (_rollOnRestart && _isFirst)
+            {
+                _isFirst = false;
+                return activeFile.exists() && activeFile.length() != 0l;
+            }
+            else
+            {
+                return super.isTriggeringEvent(activeFile, event);
+            }
+        }
+
+    }
+
+
+    private class SizeTriggeringPolicy extends SizeBasedTriggeringPolicy<ILoggingEvent>
+    {
+        private final boolean _rollOnRestart;
+        private boolean _isFirst = true;
+
+        public SizeTriggeringPolicy()
+        {
+            _rollOnRestart = isRollOnRestart();
+            setMaxFileSize(getMaxFileSize());
+
+        }
+
+        @Override
+        public boolean isTriggeringEvent(final File activeFile, final ILoggingEvent event)
+        {
+            if (_rollOnRestart && _isFirst)
+            {
+                _isFirst = false;
+                return activeFile.exists() && activeFile.length() != 0l;
+            }
+            else
+            {
+                return super.isTriggeringEvent(activeFile, event);
+            }
+        }
+
+    }
+
+    private class SimpleRollingPolicy extends FixedWindowRollingPolicy
+    {
+        private int _maxFiles;
+
+        public SimpleRollingPolicy()
+        {
+            _maxFiles = getMaxHistory();
+            setMaxIndex(getMaxHistory());
+            setMinIndex(1);
+        }
+
+        @Override
+        protected int getMaxWindowSize()
+        {
+            return _maxFiles;
+        }
+    }
+
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerFileLoggerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java Wed May  6 22:28:49 2015
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import org.apache.qpid.server.model.BrokerLogger;
+import org.apache.qpid.server.model.ManagedAttribute;
+import org.apache.qpid.server.model.ManagedObject;
+
+@ManagedObject( category = false, type = BrokerMemoryLogger.TYPE)
+public interface BrokerMemoryLogger<X extends BrokerMemoryLogger<X>> extends BrokerLogger<X>
+{
+    String TYPE = "Memory";
+
+    @ManagedAttribute( defaultValue = "4096" )
+    int getMaxRecords();
+
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java Wed May  6 22:28:49 2015
@@ -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.qpid.server.logging;
+
+import java.util.Map;
+
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ManagedAttributeField;
+import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
+
+public class BrokerMemoryLoggerImpl extends AbstractConfiguredObject<BrokerMemoryLoggerImpl> implements BrokerMemoryLogger<BrokerMemoryLoggerImpl>
+{
+
+    @ManagedAttributeField
+    private int _maxRecords;
+
+    @ManagedObjectFactoryConstructor
+    protected BrokerMemoryLoggerImpl(final Map<String, Object> attributes, Broker<?> broker)
+    {
+        super(parentsMap(broker),attributes);
+    }
+
+    @Override
+    public int getMaxRecords()
+    {
+        return _maxRecords;
+    }
+
+    @Override
+    public Appender<ILoggingEvent> asAppender()
+    {
+        ch.qos.logback.classic.Logger rootLogger =
+                (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        LoggerContext loggerContext = rootLogger.getLoggerContext();
+
+        final RecordEventAppender appender = new RecordEventAppender(getMaxRecords());
+        appender.setName(getName());
+        appender.setContext(loggerContext);
+        appender.start();
+        return appender;
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerMemoryLoggerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java Wed May  6 22:28:49 2015
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import org.apache.qpid.server.model.BrokerLoggerFilter;
+import org.apache.qpid.server.model.ManagedAttribute;
+import org.apache.qpid.server.model.ManagedObject;
+
+@ManagedObject( category = false, type = BrokerNameAndLevelFilter.TYPE)
+public interface BrokerNameAndLevelFilter<X extends BrokerNameAndLevelFilter<X>> extends BrokerLoggerFilter<X>
+{
+
+    String TYPE = "NameAndLevel";
+
+    @ManagedAttribute( defaultValue = "" )
+    String getLoggerName();
+
+    @ManagedAttribute(defaultValue = "INFO" )
+    LogLevel getLevel();
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java Wed May  6 22:28:49 2015
@@ -0,0 +1,103 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import java.util.Map;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.filter.Filter;
+import ch.qos.logback.core.spi.FilterReply;
+
+import org.apache.qpid.server.model.AbstractConfiguredObject;
+import org.apache.qpid.server.model.BrokerLogger;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.ManagedAttributeField;
+import org.apache.qpid.server.model.ManagedObjectFactoryConstructor;
+
+public class BrokerNameAndLevelFilterImpl extends AbstractConfiguredObject<BrokerNameAndLevelFilterImpl>
+        implements BrokerNameAndLevelFilter<BrokerNameAndLevelFilterImpl>
+{
+    @ManagedAttributeField
+    private String _loggerName;
+    @ManagedAttributeField
+    private LogLevel _level;
+
+    @ManagedObjectFactoryConstructor
+    protected BrokerNameAndLevelFilterImpl(final Map<String, Object> attributes, BrokerLogger<?> logger)
+    {
+        super(parentsMap(logger), attributes);
+    }
+
+    @Override
+    public String getLoggerName()
+    {
+        return _loggerName;
+    }
+
+    @Override
+    public LogLevel getLevel()
+    {
+        return _level;
+    }
+
+    @Override
+    public Filter<ILoggingEvent> asFilter()
+    {
+        final Level level = Level.toLevel(getLevel().name());
+        final String loggerName = getLoggerName();
+        if("".equals(loggerName) || Logger.ROOT_LOGGER_NAME.equals(loggerName))
+        {
+            return new Filter<ILoggingEvent>()
+            {
+                @Override
+                public FilterReply decide(final ILoggingEvent event)
+                {
+                    return event.getLevel().isGreaterOrEqual(level) ? FilterReply.ACCEPT : FilterReply.NEUTRAL;
+                }
+            };
+        }
+        else if(loggerName.endsWith(".*"))
+        {
+            final String prefixName = loggerName.substring(0,loggerName.length()-2);
+            return new Filter<ILoggingEvent>()
+            {
+                @Override
+                public FilterReply decide(final ILoggingEvent event)
+                {
+                    return event.getLevel().isGreaterOrEqual(level) && event.getLoggerName().startsWith(prefixName) ? FilterReply.ACCEPT : FilterReply.NEUTRAL;
+                }
+            };
+        }
+        else
+        {
+            return new Filter<ILoggingEvent>()
+            {
+                @Override
+                public FilterReply decide(final ILoggingEvent event)
+                {
+                    return event.getLevel().isGreaterOrEqual(level) && event.getLoggerName().equals(loggerName) ? FilterReply.ACCEPT : FilterReply.NEUTRAL;
+                }
+            };
+        }
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/BrokerNameAndLevelFilterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java Wed May  6 22:28:49 2015
@@ -0,0 +1,45 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.filter.Filter;
+import ch.qos.logback.core.spi.FilterReply;
+
+public class DenyAllFilter extends Filter<ILoggingEvent>
+{
+    private static final Filter<ILoggingEvent> INSTANCE = new DenyAllFilter();
+
+    private DenyAllFilter()
+    {
+    }
+
+    public static Filter<ILoggingEvent> getInstance()
+    {
+        return INSTANCE;
+    }
+
+    public FilterReply decide(final ILoggingEvent event)
+    {
+        return FilterReply.DENY;
+    }
+
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/DenyAllFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java Wed May  6 22:28:49 2015
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+public enum LogLevel
+{
+    ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogLevel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java Wed May  6 22:28:49 2015
@@ -0,0 +1,65 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+
+public class LogRecord
+{
+    private final ILoggingEvent _event;
+    private final int _id;
+
+    public LogRecord(int id, ILoggingEvent event)
+    {
+        _id = id;
+        _event = event;
+    }
+
+    public long getId()
+    {
+        return _id;
+    }
+
+    public long getTimestamp()
+    {
+        return _event.getTimeStamp();
+    }
+
+    public String getThreadName()
+    {
+        return _event.getThreadName();
+    }
+
+    public String getLevel()
+    {
+        return _event.getLevel().toString();
+    }
+
+    public String getMessage()
+    {
+        return _event.getFormattedMessage();
+    }
+
+    public String getLogger()
+    {
+        return _event.getLoggerName();
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecord.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LogRecorder.java Wed May  6 22:28:49 2015
@@ -17,107 +17,35 @@
 
 package org.apache.qpid.server.logging;
 
+import java.util.Collections;
 import java.util.Iterator;
-import org.apache.qpid.server.configuration.BrokerProperties;
 
-public class LogRecorder implements Iterable<LogRecorder.Record>
-{
-    private static final int DEFAULT_BUFFER_SIZE = 4096;
-    private String _name;
-    private long _recordId;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.core.helpers.CyclicBuffer;
+import org.slf4j.LoggerFactory;
 
-    private final int _bufferSize = Integer.getInteger(BrokerProperties.PROPERTY_LOG_RECORDS_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
-    private final int _mask = _bufferSize - 1;
-    private Record[] _records = new Record[_bufferSize];
+public class LogRecorder implements Iterable<LogRecord>
+{
 
-
-    public static class Record
-    {
-        private long _id;
-        private String _logger;
-        private long _timestamp;
-        private String _threadName;
-        private String _level;
-        private String _message;
-
-
-        public Record(long id)
-        {
-        }
-
-        public long getId()
-        {
-            return _id;
-        }
-
-        public long getTimestamp()
-        {
-            return _timestamp;
-        }
-
-        public String getThreadName()
-        {
-            return _threadName;
-        }
-
-        public String getLevel()
-        {
-            return _level;
-        }
-
-        public String getMessage()
-        {
-            return _message;
-        }
-
-        public String getLogger()
-        {
-            return _logger;
-        }
-    }
+    private final RecordEventAppender _eventAppender;
 
     public void closeLogRecorder()
     {
+        Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        rootLogger.detachAppender(_eventAppender);
+        _eventAppender.stop();
     }
 
     @Override
-    public Iterator<Record> iterator()
+    public Iterator<LogRecord> iterator()
     {
-        return new RecordIterator(Math.max(_recordId-_bufferSize, 0l));
+        final CyclicBuffer<LogRecord> buffer = _eventAppender.getBuffer();
+        return buffer != null ?  buffer.asList().iterator() : Collections.<LogRecord>emptyIterator();
     }
 
-    private class RecordIterator implements Iterator<Record>
+    public LogRecorder(RecordEventAppender eventAppender)
     {
-        private long _id;
-
-        public RecordIterator(long currentRecordId)
-        {
-            _id = currentRecordId;
-        }
-
-        @Override
-        public boolean hasNext()
-        {
-            return _id < _recordId;
-        }
-
-        @Override
-        public Record next()
-        {
-            Record record = _records[((int) (_id & _mask))];
-            while(_id < _recordId-_bufferSize)
-            {
-                _id = _recordId-_bufferSize;
-                record = _records[((int) (_id & _mask))];
-            }
-            _id++;
-            return record;
-        }
-
-        @Override
-        public void remove()
-        {
-            throw new UnsupportedOperationException();
-        }
+        _eventAppender = eventAppender;
     }
+
 }

Copied: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LoggingMessageLogger.java (from r1678104, qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java)
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LoggingMessageLogger.java?p2=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LoggingMessageLogger.java&p1=qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java&r1=1678104&r2=1678105&rev=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/Log4jMessageLogger.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/LoggingMessageLogger.java Wed May  6 22:28:49 2015
@@ -23,14 +23,14 @@ package org.apache.qpid.server.logging;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class Log4jMessageLogger extends AbstractMessageLogger
+public class LoggingMessageLogger extends AbstractMessageLogger
 {
-    public Log4jMessageLogger()
+    public LoggingMessageLogger()
     {
         super();
     }
 
-    public Log4jMessageLogger(boolean statusUpdatesEnabled)
+    public LoggingMessageLogger(boolean statusUpdatesEnabled)
     {
         super(statusUpdatesEnabled);
     }

Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java?rev=1678105&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java Wed May  6 22:28:49 2015
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.qpid.server.logging;
+
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.AppenderBase;
+import ch.qos.logback.core.helpers.CyclicBuffer;
+
+public class RecordEventAppender extends AppenderBase<ILoggingEvent>
+{
+
+    private CyclicBuffer<LogRecord> _buffer;
+    private final int _size;
+    private volatile int _recordId;
+
+    RecordEventAppender(final int size)
+    {
+        _size = size;
+    }
+
+    public void start()
+    {
+        _buffer = new CyclicBuffer<>(_size);
+        super.start();
+    }
+
+    public void stop()
+    {
+        _buffer = null;
+        super.stop();
+    }
+
+    @Override
+    protected void append(ILoggingEvent eventObject)
+    {
+        if (isStarted())
+        {
+            _buffer.add(new LogRecord(_recordId++,eventObject));
+        }
+    }
+
+    public CyclicBuffer<LogRecord> getBuffer()
+    {
+        return _buffer;
+    }
+}

Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/RecordEventAppender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Wed May  6 22:28:49 2015
@@ -47,8 +47,6 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -60,14 +58,7 @@ import com.google.common.util.concurrent
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.Module;
 import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.SerializerProvider;
-import org.codehaus.jackson.map.module.SimpleModule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,7 +73,6 @@ import org.apache.qpid.server.security.a
 import org.apache.qpid.server.security.encryption.ConfigurationSecretEncrypter;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
 import org.apache.qpid.server.util.Action;
-import org.apache.qpid.server.util.FutureResult;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
 import org.apache.qpid.util.Strings;
 
@@ -961,9 +951,15 @@ public abstract class AbstractConfigured
                     }
                 }
             });
+            postResolveChildren();
         }
     }
 
+    protected void postResolveChildren()
+    {
+
+    }
+
     protected void postResolve()
     {
     }
@@ -2398,27 +2394,6 @@ public abstract class AbstractConfigured
 
     private static class OwnAttributeResolver implements Strings.Resolver
     {
-        private static final Module _module;
-        static
-        {
-            SimpleModule module= new SimpleModule("ConfiguredObjectSerializer", new Version(1,0,0,null));
-
-            final JsonSerializer<ConfiguredObject> serializer = new JsonSerializer<ConfiguredObject>()
-            {
-                @Override
-                public void serialize(final ConfiguredObject value,
-                                      final JsonGenerator jgen,
-                                      final SerializerProvider provider)
-                        throws IOException, JsonProcessingException
-                {
-                    jgen.writeString(value.getId().toString());
-                }
-            };
-            module.addSerializer(ConfiguredObject.class, serializer);
-
-            _module = module;
-        }
-
 
         public static final String PREFIX = "this:";
         private final ThreadLocal<Set<String>> _stack = new ThreadLocal<>();
@@ -2428,8 +2403,7 @@ public abstract class AbstractConfigured
         public OwnAttributeResolver(final ConfiguredObject<?> object)
         {
             _object = object;
-            _objectMapper = new ObjectMapper();
-            _objectMapper.registerModule(_module);
+            _objectMapper = ConfiguredObjectJacksonModule.newObjectMapper();
         }
 
         @Override

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObjectTypeFactory.java Wed May  6 22:28:49 2015
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.server.model;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java?rev=1678105&r1=1678104&r2=1678105&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractSystemConfig.java Wed May  6 22:28:49 2015
@@ -55,7 +55,6 @@ public abstract class AbstractSystemConf
 {
     private static final UUID SYSTEM_ID = new UUID(0l, 0l);
     private final EventLogger _eventLogger;
-    private final LogRecorder _logRecorder;
 
     private DurableConfigurationStore _configurationStore;
 
@@ -86,15 +85,13 @@ public abstract class AbstractSystemConf
 
     public AbstractSystemConfig(final TaskExecutor taskExecutor,
                                 final EventLogger eventLogger,
-                                final LogRecorder logRecorder,
-                                final Map<String,Object> attributes)
+                                final Map<String, Object> attributes)
     {
         super(parentsMap(),
               updateAttributes(attributes),
               taskExecutor, BrokerModel.getInstance());
         _eventLogger = eventLogger;
         getTaskExecutor().start();
-        _logRecorder = logRecorder;
     }
 
     private static Map<String, Object> updateAttributes(Map<String, Object> attributes)
@@ -117,11 +114,6 @@ public abstract class AbstractSystemConf
         return _eventLogger;
     }
 
-    public LogRecorder getLogRecorder()
-    {
-        return _logRecorder;
-    }
-
     @Override
     protected void onClose()
     {
@@ -133,10 +125,6 @@ public abstract class AbstractSystemConf
                 getTaskExecutor().stop();
             }
 
-            _eventLogger.message(BrokerMessages.STOPPED());
-
-            _logRecorder.closeLogRecorder();
-
             _configurationStore.closeConfigurationStore();
 
         }
@@ -212,22 +200,6 @@ public abstract class AbstractSystemConf
             startupLogger = eventLogger;
         }
 
-        startupLogger.message(BrokerMessages.STARTUP(QpidProperties.getReleaseVersion(),
-                                                     QpidProperties.getBuildVersion()));
-
-        startupLogger.message(BrokerMessages.PLATFORM(System.getProperty("java.vendor"),
-                                                      System.getProperty("java.runtime.version",
-                                                                         System.getProperty("java.version")),
-                                                      SystemUtils.getOSName(),
-                                                      SystemUtils.getOSVersion(),
-                                                      SystemUtils.getOSArch()));
-
-        startupLogger.message(BrokerMessages.MAX_MEMORY(Runtime.getRuntime().maxMemory()));
-
-        if (SystemUtils.getProcessPid() != null)
-        {
-            startupLogger.message(BrokerMessages.PROCESS(SystemUtils.getProcessPid()));
-        }
 
         BrokerStoreUpgraderAndRecoverer upgrader = new BrokerStoreUpgraderAndRecoverer(this);
         upgrader.perform();



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


Mime
View raw message