use of com.yahoo.athenz.common.server.log.AuditLoggerFactory in project athenz by yahoo.
the class AuditLogMsgBuilderTest method starter.
DefaultAuditLogMsgBuilder starter(final String whatApi) {
AuditLoggerFactory auditLoggerFactory = new DefaultAuditLoggerFactory();
AuditLogger logger = auditLoggerFactory.create();
AuditLogMsgBuilder msgBldr = logger.getMsgBuilder();
msgBldr.who(TOKEN_STR).when("now-timestamp").clientIp("12.12.12.12").whatApi(whatApi);
return (DefaultAuditLogMsgBuilder) msgBldr;
}
use of com.yahoo.athenz.common.server.log.AuditLoggerFactory in project athenz by yahoo.
the class AuditLoggerTest method testLogMsgBuilder.
@Test
public void testLogMsgBuilder() {
AuditLoggerFactory auditLoggerFactory = new DefaultAuditLoggerFactory();
AuditLogger logger = auditLoggerFactory.create();
AuditLogMsgBuilder msgBldr = logger.getMsgBuilder();
auditLogger.log(msgBldr);
}
use of com.yahoo.athenz.common.server.log.AuditLoggerFactory in project athenz by yahoo.
the class AuditLoggerTest method testLogFactoryDefault.
@Test
public void testLogFactoryDefault() {
AuditLoggerFactory auditLoggerFactory = new DefaultAuditLoggerFactory();
AuditLogger logger = auditLoggerFactory.create();
logger.log("Default logger succeeds", MSGVERS);
}
use of com.yahoo.athenz.common.server.log.AuditLoggerFactory in project athenz by yahoo.
the class ZTSImpl method loadAuditLogger.
void loadAuditLogger() {
String auditFactoryClass = System.getProperty(ZTSConsts.ZTS_PROP_AUDIT_LOGGER_FACTORY_CLASS, ZTSConsts.ZTS_AUDIT_LOGGER_FACTORY_CLASS);
AuditLoggerFactory auditLogFactory = null;
try {
auditLogFactory = (AuditLoggerFactory) Class.forName(auditFactoryClass).newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
LOGGER.error("Invalid AuditLoggerFactory class: " + auditFactoryClass + " error: " + e.getMessage());
throw new IllegalArgumentException("Invalid audit logger class");
}
// create our audit logger
auditLogger = auditLogFactory.create();
}
use of com.yahoo.athenz.common.server.log.AuditLoggerFactory in project athenz by yahoo.
the class ZMSImpl method loadAuditLogger.
void loadAuditLogger() {
String auditFactoryClass = System.getProperty(ZMSConsts.ZMS_PROP_AUDIT_LOGGER_FACTORY_CLASS, ZMSConsts.ZMS_AUDIT_LOGGER_FACTORY_CLASS);
AuditLoggerFactory auditLogFactory = null;
try {
auditLogFactory = (AuditLoggerFactory) Class.forName(auditFactoryClass).newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
LOG.error("Invalid AuditLoggerFactory class: " + auditFactoryClass + " error: " + e.getMessage());
throw new IllegalArgumentException("Invalid audit logger class");
}
// create our audit logger
auditLogger = auditLogFactory.create();
}
Aggregations