Skip to content

Commit

Permalink
Default standard output to the journal in systemd
Browse files Browse the repository at this point in the history
This commit modifies the default setting for standard output in the
systemd configuration to the journal instead of /dev/null. This is to
address a user pain point where Elasticsearch would fail to start but
the error message would be sent to standard output and therefore
/dev/null leading to difficult-to-debug situations.
  • Loading branch information
jasontedor committed Jan 21, 2016
1 parent 7de8d28 commit 26e5cd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 2 additions & 5 deletions distribution/src/main/packaging/systemd/elasticsearch.service
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ ExecStart=/usr/share/elasticsearch/bin/elasticsearch \
-Des.default.path.data=${DATA_DIR} \
-Des.default.path.conf=${CONF_DIR}

# Connects standard output to /dev/null
StandardOutput=null

# Connects standard error to journal
StandardError=journal
StandardOutput=journal
StandardError=inherit

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65535
Expand Down
11 changes: 11 additions & 0 deletions docs/reference/migration/migrate_3_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,14 @@ When percolating an existing document then specifying a document in the source o
any more.

Percolator documents are no longer excluded from the search response.

=== Default logging using systemd

In previous versions of Elasticsearch, the default logging
configuration routed standard output to /dev/null and standard error to
the journal. However, there are often critical error messages at
startup that are logged to standard output rather than standard error
and these error messages would be lost to the nether. The default has
changed to now route standard output to the journal and standard error
to inherit this setting (these are the defaults for systemd). These
settings can be modified by editing the elasticsearch.service file.

0 comments on commit 26e5cd6

Please sign in to comment.