From 98ad2596d881529778ee407431753282e3ae3f98 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 13 Mar 2018 16:32:16 -0400 Subject: [PATCH] Put JVM crash logs in the default log directory (#29028) This commit adds a JVM flag to ensure that the JVM fatal error logs land in the default log directory. Users that wish to use an alternative location should change the path configured here. --- distribution/build.gradle | 6 ++++++ distribution/src/config/jvm.options | 3 +++ 2 files changed, 9 insertions(+) diff --git a/distribution/build.gradle b/distribution/build.gradle index 5bb9944b4a3..f3fe27168f7 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -265,6 +265,12 @@ subprojects { 'def': "#-XX:HeapDumpPath=/heap/dump/path" ], + 'error.file': [ + 'deb': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log", + 'rpm': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log", + 'def': "#-XX:ErrorFile=/error/file/path" + ], + 'stopping.timeout': [ 'rpm': 86400, ], diff --git a/distribution/src/config/jvm.options b/distribution/src/config/jvm.options index eb3d772fa56..e862343de8d 100644 --- a/distribution/src/config/jvm.options +++ b/distribution/src/config/jvm.options @@ -81,6 +81,9 @@ # ensure the directory exists and has sufficient space ${heap.dump.path} +# specify an alternative path for JVM fatal error logs +${error.file} + ## JDK 8 GC logging 8:-XX:+PrintGCDetails