Skip to content

Commit ca10abc

Browse files
committed
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.
1 parent 2b52043 commit ca10abc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

distribution/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ subprojects {
265265
'def': "#-XX:HeapDumpPath=/heap/dump/path"
266266
],
267267

268+
'error.file': [
269+
'deb': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
270+
'rpm': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
271+
'def': "#-XX:ErrorFile=/error/file/path"
272+
],
273+
268274
'stopping.timeout': [
269275
'rpm': 86400,
270276
],

distribution/src/config/jvm.options

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
# ensure the directory exists and has sufficient space
8282
${heap.dump.path}
8383

84+
# specify an alternative path for JVM fatal error logs
85+
${error.file}
86+
8487
## JDK 8 GC logging
8588

8689
8:-XX:+PrintGCDetails

0 commit comments

Comments
 (0)