Skip to content

Commit 0abf51a

Browse files
authored
Configure error file for archive packages (elastic#29129)
This is a follow up to a previous change which set the error file path for the package distributions. The observation here is that we always set the working directory of Elasticsearch to the root of the installation (i.e., Elasticsearch home). Therefore, we can specify the error file path relative to this directory and default it to the logs directory, similar to the package distributions.
1 parent 29fedb2 commit 0abf51a

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

distribution/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ subprojects {
268268
'error.file': [
269269
'deb': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
270270
'rpm': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
271-
'def': "#-XX:ErrorFile=/error/file/path"
271+
'def': "-XX:ErrorFile=logs/hs_err_pid%p.log"
272272
],
273273

274274
'stopping.timeout': [
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
[[error-file-path]]
22
=== JVM fatal error logs
33

4-
The <<rpm,RPM>> and <<deb,Debian>> package distributions default to configuring
5-
the JVM to write fatal error logs to `/var/lib/elasticsearch`; these are logs
6-
produced by the JVM when it encounters a fatal error (e.g., a segmentation
7-
fault). If this path is not suitable for receiving logs, you should modify the
8-
entry `-XX:ErrorFile=/var/lib/elasticsearch/hs_err_pid%p.log` in
4+
By default, Elasticsearch configures the JVM to write fatal error logs
5+
to the default logging directory (this is `/var/log/elasticsearch` for
6+
the <<rpm,RPM>> and <<deb,Debian>> package distributions, and the `logs`
7+
directory under the root of the Elasticsearch installation for the
8+
<<zip-targz,tar and zip>> archive distributions). These are logs
9+
produced by the JVM when it encounters a fatal error (e.g., a
10+
segmentation fault). If this path is not suitable for receiving logs,
11+
you should modify the entry `-XX:ErrorFile=...` in
912
<<jvm-options,`jvm.options`>> to an alternate path.
10-
11-
Note that the archive distributions do not configure the error file path by
12-
default. Instead, the JVM will default to writing to the working directory for
13-
the Elasticsearch process. If you wish to configure an error file path, you
14-
should modify the entry `#-XX:ErrorFile=/error/file/path` in
15-
<<jvm-options,`jvm.options`>> to remove the comment marker `#` and to specify an
16-
actual path.

0 commit comments

Comments
 (0)