ekaterinadimitrova2 commented on a change in pull request #1051:
URL: https://github.com/apache/cassandra/pull/1051#discussion_r688174199
##########
File path: src/java/org/apache/cassandra/audit/AuditLogManager.java
##########
@@ -83,16 +86,27 @@ public void initialize()
{
if (DatabaseDescriptor.getAuditLoggingOptions().enabled)
registerAsListener();
+
+ if (!MBeanWrapper.instance.isRegistered(MBEAN_NAME))
+ MBeanWrapper.instance.registerMBean(this, MBEAN_NAME);
}
- private IAuditLogger getAuditLogger(ParameterizedClass logger) throws
ConfigurationException
+ private IAuditLogger getAuditLogger(AuditLogOptions options) throws
ConfigurationException
{
- if (logger.class_name != null)
+ final ParameterizedClass logger = options.logger;
+
+ if (logger != null && logger.class_name != null)
{
return FBUtilities.newAuditLogger(logger.class_name,
logger.parameters == null ? Collections.emptyMap() : logger.parameters);
}
- return FBUtilities.newAuditLogger(BinAuditLogger.class.getName(),
Collections.emptyMap());
+ return new BinAuditLogger(options);
+ }
+
+ @Override
+ public CompositeData getAuditLogOptionsData()
+ {
+ return
AuditLogOptionsCompositeData.toCompositeData(AuditLogManager.instance.getAuditLogOptions());
Review comment:
nit: And I leave it really to you to decide but I would probably put
this method before or after` getAuditLogOptions`
The methods in between are short but this might change and I feel those two
will be probably better together. Feel free to ignore me if you don't like the
suggestion :-)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]