You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "beobal (via GitHub)" <gi...@apache.org> on 2025/10/10 12:55:40 UTC

Re: [PR] AuditLogEntry's host should report the native address/port [cassandra]

beobal commented on code in PR #4331:
URL: https://github.com/apache/cassandra/pull/4331#discussion_r2419223935


##########
src/java/org/apache/cassandra/audit/AuditLogEntry.java:
##########
@@ -78,6 +81,7 @@ String getLogString(String keyValueSeparator, String fieldSeparator)
     {
         StringBuilder builder = new StringBuilder(100);
         builder.append("user").append(keyValueSeparator).append(user)
+               .append(fieldSeparator).append("localHostId").append(keyValueSeparator).append(localHostId)

Review Comment:
   it would be more consistent to name this field `host_id` or `hostid`,  the camel case looks a bit odd in the log output and in other contexts like `nodetool status` or `gossipinfo`  we don't use the `local` prefix



##########
src/java/org/apache/cassandra/audit/AuditLogEntry.java:
##########
@@ -66,6 +68,7 @@ private AuditLogEntry(Builder builder)
         this.options = builder.options;
         this.state = builder.state;
         this.metadata = builder.metadata;
+        this.localHostId = StorageService.instance.getLocalHostId();

Review Comment:
   I have a bit of a preference for passing in the id, rather than calling out to the static instance in the constructor. Maybe the `Builder` should handle this?



-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org