From 2c55d85aa5553d296a0515bbe92b5e3f34d46112 Mon Sep 17 00:00:00 2001 From: uboness Date: Thu, 22 Jan 2015 02:48:38 +0100 Subject: [PATCH] [Audit] Changed the log entry prefix configuration Prepended `emit_` to each of the settings to make it clearer what they're all about. Original commit: elastic/x-pack-elasticsearch@8e648eee235701036dbcbaabe1878122c9bb36c5 --- .../shield/audit/logfile/LoggingAuditTrail.java | 6 +++--- .../shield/audit/logfile/LoggingAuditTrailTests.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrail.java b/src/main/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrail.java index 6aef9ec8713..10a32eb0d3e 100644 --- a/src/main/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrail.java +++ b/src/main/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrail.java @@ -268,7 +268,7 @@ public class LoggingAuditTrail implements AuditTrail { static String resolvePrefix(Settings settings) { StringBuilder builder = new StringBuilder(); - if (settings.getAsBoolean("shield.audit.logfile.prefix.node_host_address", false)) { + if (settings.getAsBoolean("shield.audit.logfile.prefix.emit_node_host_address", false)) { try { String address = InetAddress.getLocalHost().getHostAddress(); builder.append("[").append(address).append("] "); @@ -276,7 +276,7 @@ public class LoggingAuditTrail implements AuditTrail { // ignore } } - if (settings.getAsBoolean("shield.audit.logfile.prefix.node_host_name", false)) { + if (settings.getAsBoolean("shield.audit.logfile.prefix.emit_node_host_name", false)) { try { String hostName = InetAddress.getLocalHost().getHostName(); builder.append("[").append(hostName).append("] "); @@ -284,7 +284,7 @@ public class LoggingAuditTrail implements AuditTrail { // ignore } } - if (settings.getAsBoolean("shield.audit.logfile.prefix.node_name", true)) { + if (settings.getAsBoolean("shield.audit.logfile.prefix.emit_node_name", true)) { String name = settings.get("name"); if (name != null) { builder.append("[").append(name).append("] "); diff --git a/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java b/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java index be4d3bb1bbf..86fabb6c95c 100644 --- a/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java +++ b/src/test/java/org/elasticsearch/shield/audit/logfile/LoggingAuditTrailTests.java @@ -106,9 +106,9 @@ public class LoggingAuditTrailTests extends ElasticsearchTestCase { @Before public void init() throws Exception { settings = ImmutableSettings.builder() - .put("shield.audit.logfile.prefix.node_host_address", randomBoolean()) - .put("shield.audit.logfile.prefix.node_host_name", randomBoolean()) - .put("shield.audit.logfile.prefix.node_name", randomBoolean()) + .put("shield.audit.logfile.prefix.emit_node_host_address", randomBoolean()) + .put("shield.audit.logfile.prefix.emit_node_host_name", randomBoolean()) + .put("shield.audit.logfile.prefix.emit_node_name", randomBoolean()) .build(); prefix = LoggingAuditTrail.resolvePrefix(settings); }