private static void commit(Level level, Map<String, Object> message) throws AuditLoggingException {
try {
private static void commit(Level level, Map<String, Object> message) throws AuditLoggingException {
try {
- AuditLoggingAPIClient client = fromEnv().apiClient;
- if (client == null) {
+ AuditLoggingClient client = fromEnv();
+ if (client == null || client.apiClient == null) {
// No can do - at least log to file
LOGGER.warn("Audit logging server not configured - printing event to log");
LOGGER.info(message.toString());
} else {
// No can do - at least log to file
LOGGER.warn("Audit logging server not configured - printing event to log");
LOGGER.info(message.toString());
} else {
+ AuditLoggingAPIClient apiClient = client.apiClient;
switch (level) {
case INFO:
switch (level) {
case INFO:
+ apiClient.log(message);
+ apiClient.error(message);
+ apiClient.trace(message);