Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM package: Do not log into systemd journal #17220

Closed
spinscale opened this issue Mar 21, 2016 · 9 comments · Fixed by #20422
Closed

RPM package: Do not log into systemd journal #17220

spinscale opened this issue Mar 21, 2016 · 9 comments · Fixed by #20422
Assignees
Labels
blocker :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team v5.0.0-beta1

Comments

@spinscale
Copy link
Contributor

When the RPM package is installed and elasticsearch is started via systemd, every log message is logged in /var/log/elasticsearch/ and to the systemd journal, which can be accessed using the journalctl tool.

I dont think we should put anything into the journal, especially as most other services seem to be kinda scarce on output in there (given my vagrant vm).

Open for discussion.

@spinscale spinscale added blocker discuss :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v5.0.0-alpha1 labels Mar 21, 2016
@dakrone
Copy link
Member

dakrone commented Mar 21, 2016

@spinscale why not? Storing the logs in the journal allows an administrator to do something like: journalctl _PID=1234 --since "20 min ago" that is more difficult to do tailing logs.

Is there any reason why shouldn't put logs in it on systemd systems?

@spinscale
Copy link
Contributor Author

As far as my knowledge about systemd journal goes, by default it cleans itself up in case it takes up too much space. If Elasticsearch is on a log blast, we fill up the disk twice (which I dont care too much about, monitoring will kick in and notify), but this might expire other important entries out of the journal logs, where we have the es logs anyway.

That said, I do like the querying capabilties :)

@dakrone
Copy link
Member

dakrone commented Mar 21, 2016

If Elasticsearch is on a log blast, we fill up the disk twice (which I dont care too much about, monitoring will kick in and notify), but this might expire other important entries out of the journal logs, where we have the es logs anyway.

That sounds like evidence that we should log only to the journal on systemd machines, since you can easily configure the journal to write to a log file additionally.

@nik9000
Copy link
Member

nik9000 commented Mar 21, 2016

So long as we only log one place I really don't care which place that is.

@jasontedor
Copy link
Member

I'm in favor of systemd logging, but if we are only going to log to one place I think that it should be /var/log/elasticsearch/elasticsearch.log; the journal can be confusing, and has caused trouble for users in the past (because they don't know to look there, and the vast body of knowledge accessible through searches will point people towards /var/log/elasticsearch/elasticsearch.log rather than systemd). See #16159 and the related issues for some recent issues that support this.

We can provide commented out journal configuration for end-users that want this instead of the simpler default.

@tlrx
Copy link
Member

tlrx commented Mar 21, 2016

When it comes to elasticsearch as a system service I think we should try to integrate as much as possible with the OS features. I feel like systemd is adopted by more and more distributions and the journalctl is really powerful. We could enable persistent log with a max file size and compress by default.

Concerning the vast body of knowledge referring to /var/log/elasticsearch/elasticsearch.log file, I think dropping a file there with a single line comment saying to look at the journal is OK.

@jasontedor
Copy link
Member

@tlrx I'm all in favor in systemd but my argument is merely that if we are going to pick one, we should pick the simplest. As an added note, on all other systems we still have to support /var/log/elasticsearch/elasticsearch.log.

We could enable persistent log with a max file size and compress by default.

We can also provide a logrotate.d conf file for this.

Concerning the vast body of knowledge referring to /var/log/elasticsearch/elasticsearch.log file, I think dropping a file there with a single line comment saying to look at the journal is OK.

That does not alleviate my concerns that I've encountered many end users that have found the journal confusing.

@spinscale
Copy link
Contributor Author

I also completely forgot we are still bound to maintain init.d based systems, due to LTS releases from various distributions.

Proposal from my side, unless we are on systemd exclusively (lets see if that works out without another dozen of init systems jumping into existence): Remove the console from logging.yml, but also add documentation how to do systemd logging exclusively and include some of the nice command line arguments that Lee showed off above and mentioning to not care about log rotatation in that case.

@clintongormley
Copy link

Discussed in FixitFriday, agreed with #17220 (comment),, especially given that having logs in a standard place makes it easier for our diagnostic tools to capture them

@clintongormley clintongormley added help wanted adoptme and removed discuss labels Sep 2, 2016
@jasontedor jasontedor self-assigned this Sep 8, 2016
@jasontedor jasontedor removed the help wanted adoptme label Sep 8, 2016
@clintongormley clintongormley assigned tlrx and unassigned jasontedor Sep 9, 2016
tlrx added a commit to tlrx/elasticsearch that referenced this issue Sep 13, 2016
This commit adds a -q/--quiet option to Elasticsearch so that it does not log anything in the console and closes stdout & stderr streams. This is useful for SystemD to avoid duplicate logs in both journalctl and /var/log/elasticsearch/elasticsearch.log while still allows the JVM to print error messages in stdout/stderr if needed.

closes elastic#17220
tlrx added a commit that referenced this issue Sep 13, 2016
This commit adds a -q/--quiet option to Elasticsearch so that it does not log anything in the console and closes stdout & stderr streams. This is useful for SystemD to avoid duplicate logs in both journalctl and /var/log/elasticsearch/elasticsearch.log while still allows the JVM to print error messages in stdout/stderr if needed.

closes #17220

(cherry picked from commit 6090c51)
tlrx added a commit that referenced this issue Sep 13, 2016
This commit adds a -q/--quiet option to Elasticsearch so that it does not log anything in the console and closes stdout & stderr streams. This is useful for SystemD to avoid duplicate logs in both journalctl and /var/log/elasticsearch/elasticsearch.log while still allows the JVM to print error messages in stdout/stderr if needed.

closes #17220

(cherry picked from commit 6090c51)
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team v5.0.0-beta1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants