From c7270d7404a3bda7c7cd0cf7a0e7a8f687602988 Mon Sep 17 00:00:00 2001 From: Justin Field Date: Fri, 25 Jan 2019 15:47:48 -0800 Subject: [PATCH] Source hostname from InetAddress as the HOSTNAME env var is not always set (#185) --- src/main/resources/logback.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/logback.groovy b/src/main/resources/logback.groovy index a3d97eef8..6bf45dae8 100644 --- a/src/main/resources/logback.groovy +++ b/src/main/resources/logback.groovy @@ -205,7 +205,7 @@ logger("ACCESS_LOG", accessLogLevel, allAsyncAccessLogAppendersArray, false) // Auditable Events if (ConfigService.getInstance().isAuditLoggingEnabled()) { - def hostname = System.getenv('HOSTNAME') + def hostname = System.getenv('HOSTNAME') ? System.getenv('HOSTNAME') : InetAddress.getLocalHost().getHostName() appender("audit-log-appender", FiveMinuteRollingFileAppender) { file = "${LOG_FILE_DIRECTORY_PATH}/${hostname}-audit.log"