eanbiso commented on code in PR #4408:
URL: https://github.com/apache/activemq-artemis/pull/4408#discussion_r1141716114
##########
artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java:
##########
@@ -2639,4 +2644,18 @@ static void isAutoDelete(Object source) {
@LogMessage(id = 601766, value = "User {} is getting auto-delete property
on target resource: {}", level = LogMessage.Level.INFO)
void isAutoDelete(String user, Object source);
+
+ static void createdConnection(String protocol, Object connectionID, String
remoteAddress) {
+ CONNECTION_LOGGER.createdConnection(protocol, connectionID.toString(),
String.format("unknown%s", formatRemoteAddress(remoteAddress)));
Review Comment:
Why does the user value always start with 'unknown'?
If there is no way to find the user here, maybe we could review the
`@LogMessage(id = 601767, value = "{} connection {} for user {} created",
level = LogMessage.Level.INFO)
void createdConnection(String protocol, String connectionID, String user);`
log template, replacing the 'user' info with some other field... what do you
think?
##########
artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java:
##########
@@ -2639,4 +2644,18 @@ static void isAutoDelete(Object source) {
@LogMessage(id = 601766, value = "User {} is getting auto-delete property
on target resource: {}", level = LogMessage.Level.INFO)
void isAutoDelete(String user, Object source);
+
+ static void createdConnection(String protocol, Object connectionID, String
remoteAddress) {
Review Comment:
Why is the 'connectionID' an Object, while in other methods it is a String?
If it is possible, it would be better to manage it in the same way, and
having a String seems to me a cleaner way.
Furthermore, managing it as an Object could bring to unexpected NPE, in case
it is null, once the 'toString' method will be invoked.
##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/security/impl/SecurityStoreImpl.java:
##########
@@ -380,7 +380,7 @@ private void authenticationFailed(String user,
RemotingConnection connection) th
ActiveMQServerLogger.LOGGER.securityProblemWhileAuthenticating(e.getMessage());
if (AuditLogger.isResourceLoggingEnabled()) {
- AuditLogger.userFailedAuthenticationInAudit(null, e.getMessage());
+ AuditLogger.userFailedAuthenticationInAudit(null, e.getMessage(),
connection.getID().toString());
Review Comment:
I have a doubt here: why is the user (first parameter) always null? Is there
no way to find it?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]