[ 
https://issues.apache.org/jira/browse/QPID-8515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17347122#comment-17347122
 ] 

ASF GitHub Bot commented on QPID-8515:
--------------------------------------

alex-rufous commented on a change in pull request #85:
URL: https://github.com/apache/qpid-broker-j/pull/85#discussion_r634671457



##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
##########
@@ -722,7 +728,7 @@ public void onFailure(final Throwable t)
                 childCloseFutures.add(childCloseFuture);
             }
         });
-
+        //deleteOperationalLog();

Review comment:
       commented code

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
##########
@@ -2974,6 +2979,79 @@ else if(desiredState instanceof String)
         }
     }
 
+    protected void changeAttributesOperationalLog(final Map<String, Object> 
attributes)
+    {
+        final String attributesString = attributes.entrySet()
+                                                  .stream()
+                                                  .filter(e -> 
_attributeTypes.get(e.getKey()) != null)
+                                                  .map(e -> {
+                                                      
ConfiguredObjectAttribute<?, ?> attributeType =
+                                                              
_attributeTypes.get(e.getKey());
+                                                      Object value;
+                                                      if 
(attributeType.isSecureValue(e.getValue()))
+                                                      {
+                                                          value = 
SECURED_STRING_VALUE;
+                                                      }
+                                                      else
+                                                      {
+                                                          value = e.getValue();
+                                                      }
+                                                      return 
String.format("%s=%s", e.getKey(), value);
+                                                  
}).collect(Collectors.joining(",", "[", "]"));
+
+        EventLogger eventLogger = getEventLogger();
+        if(eventLogger !=null)
+        {
+            getEventLogger().message(getManagementLogSubject(),
+                                     
ManagementMessages.UPDATE(getCategoryClass().getSimpleName(),
+                                                               getType(),
+                                                               getName(),
+                                                               
attributesString));
+        }
+    }
+
+    protected void createOperationalLog(final Map<String, Object> attributes){
+        final String attributeString = attributes.entrySet().stream()
+                                                 .map(e -> {
+                                                     ConfiguredObjectAttribute 
attributeType =

Review comment:
       duplicate code

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/logging/messages/Management_logmessages.properties
##########
@@ -0,0 +1,43 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+
+# 0 - category
+# 1 - type
+# 2 - name
+# 3 - attributes
+CREATE = MNG-2001 : Created : {0} : {1} : {2} {3}
+
+# 0 - category
+# 1 - type
+# 2 - name
+# 3 - attributes
+UPDATE = MNG-2002 : Updated : {0} : {1} : {2} {3}
+
+# 0 - category
+# 1 - type
+# 2 - name
+DELETE = MNG-2003 : Deleted : {0} : {1} : {2}
+
+# 0 - category
+# 1 - type
+# 2 - name
+# 3 - parameters
+OPERATION = MNG-2003 : Deleted : {0} : {1} : {2}  {3}

Review comment:
       new line expected

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/security/group/GroupImpl.java
##########
@@ -44,6 +44,7 @@ public GroupImpl(Map<String, Object> attributes,
                      GroupProvider<?> provider)
     {
         super(provider, attributes);
+        createOperationalLog(attributes);

Review comment:
       let's move call into onCreate

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
##########
@@ -313,6 +313,7 @@ public String getPath()
         public GroupAdapter(Map<String, Object> attributes)
         {
             super(FileBasedGroupProviderImpl.this, attributes);
+            createOperationalLog(attributes);

Review comment:
       let's move call into onCreate

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
##########
@@ -391,6 +392,7 @@ public GroupMemberAdapter(Map<String, Object> attrMap)
             {
                 // TODO - need to relate to the User object
                 super(GroupAdapter.this, attrMap);
+                createOperationalLog(attrMap);

Review comment:
       let's move call into onCreate

##########
File path: 
broker-core/src/main/java/org/apache/qpid/server/security/group/GroupMemberImpl.java
##########
@@ -43,6 +43,7 @@
     public GroupMemberImpl(Map<String, Object> attributes, Group group)
     {
         super((ConfiguredObject<?>) group, attributes);
+        createOperationalLog(attributes);

Review comment:
       let's move call into onCreate




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Improve operational logging and log every change to the broker state
> --------------------------------------------------------------------
>
>                 Key: QPID-8515
>                 URL: https://issues.apache.org/jira/browse/QPID-8515
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Broker-J
>    Affects Versions: qpid-java-broker-8.0.4
>            Reporter: Dedeepya
>            Priority: Major
>             Fix For: qpid-java-broker-8.0.5
>
>
> Currently there is a gap in operational logging, where the deletion of access 
> control groups is not logged. We need to identify any other such gaps and fix 
> it to log every change happening to the broker state.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to