summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bakken <luke@bakken.io>2018-08-02 15:16:09 -0700
committerGitHub <noreply@github.com>2018-08-02 15:16:09 -0700
commitca55dc9b25b895b8c6cbbdc6fd8402179fed5733 (patch)
tree9eef05a8551a8fe6095b208bb6a3859b432debf1
parentb211e288263f09b9eba08638651a3ff96f1e89d4 (diff)
parent033339aa2044b8b21534ece3e8b4a4d8cbd0ef7c (diff)
downloadrabbitmq-server-git-ca55dc9b25b895b8c6cbbdc6fd8402179fed5733.tar.gz
Merge pull request #1658 from rabbitmq/lrb-add-hostname-syslog-support
Add support for syslog server hostname
-rw-r--r--Makefile2
-rw-r--r--priv/schema/rabbit.schema21
-rw-r--r--test/config_schema_SUITE_data/rabbit.snippets6
3 files changed, 26 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7a7331bb0b..b1556e8504 100644
--- a/Makefile
+++ b/Makefile
@@ -136,7 +136,7 @@ BUILD_DEPS = rabbitmq_cli
DEPS = ranch syslog lager rabbit_common
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers amqp_client meck proper
-dep_syslog = git https://github.com/schlagert/syslog 3.4.2
+dep_syslog = git https://github.com/schlagert/syslog 3.4.3
define usage_xml_to_erl
$(subst __,_,$(patsubst $(DOCS_DIR)/rabbitmq%.1.xml, src/rabbit_%_usage.erl, $(subst -,_,$(1))))
diff --git a/priv/schema/rabbit.schema b/priv/schema/rabbit.schema
index 862537bf61..a7eaed2654 100644
--- a/priv/schema/rabbit.schema
+++ b/priv/schema/rabbit.schema
@@ -1067,6 +1067,7 @@ end}.
{mapping, "log.syslog", "rabbit.log.syslog.enabled", [
{datatype, {enum, [true, false]}}
]}.
+
{mapping, "log.syslog.level", "rabbit.log.syslog.level", [
{datatype, {enum, [debug, info, notice, warning, error, critical, alert, emergency, none]}}
]}.
@@ -1091,6 +1092,26 @@ end}.
{validators, ["is_ip"]}
]}.
+{mapping, "log.syslog.host", "syslog.dest_host", [
+ {datatype, string}
+]}.
+
+{translation, "syslog.dest_host",
+fun(Conf) ->
+ case cuttlefish:conf_get("log.syslog", Conf) of
+ true ->
+ case cuttlefish:conf_get("log.syslog.ip", Conf, undefined) of
+ undefined ->
+ % If log.syslog.ip is not set, then this must be set
+ cuttlefish:conf_get("log.syslog.host", Conf);
+ IpAddr ->
+ IpAddr
+ end;
+ _ ->
+ cuttlefish:invalid("log.syslog must be set to true to set log.syslog.host or log.syslog.ip")
+ end
+end}.
+
{mapping, "log.syslog.port", "syslog.dest_port", [
{datatype, integer}
]}.
diff --git a/test/config_schema_SUITE_data/rabbit.snippets b/test/config_schema_SUITE_data/rabbit.snippets
index 3dce388b79..685b05b3dc 100644
--- a/test/config_schema_SUITE_data/rabbit.snippets
+++ b/test/config_schema_SUITE_data/rabbit.snippets
@@ -554,10 +554,12 @@ credential_validator.regexp = ^abc\\d+",
{log_syslog_tcp,
"log.syslog = true
log.syslog.transport = tcp
- log.syslog.protocol = rfc5424",
+ log.syslog.protocol = rfc5424
+ log.syslog.host = syslog.my-network.com",
[
{rabbit,[{log, [{syslog, [{enabled, true}]}]}]},
- {syslog, [{protocol, {rfc5424, tcp}}]}
+ {syslog, [{protocol, {rfc5424, tcp}},
+ {dest_host, "syslog.my-network.com"}]}
],
[]},
{log_syslog_udp_default,