Skip to content

[deb/rpm] set logging.dest#74896

Merged
jbudz merged 20 commits intoelastic:masterfrom
jbudz:package/logging_dest
Oct 29, 2020
Merged

[deb/rpm] set logging.dest#74896
jbudz merged 20 commits intoelastic:masterfrom
jbudz:package/logging_dest

Conversation

@jbudz
Copy link
Copy Markdown
Contributor

@jbudz jbudz commented Aug 12, 2020

This adds a CLI arg for sysv and systemd to set logging dest.

In cases where the logger still isn't initialized logs are sent to the kibana.log or the system journal (journalctl -u kibana.server) respectively. I'm undecided what we want here, this is the prior behavior but inconsistent.

We also may want to consider this as a breaking change

Closes #6579

Release note

Fixes the logging destination for systemd installations and and updates the sysv filename to be consistent with other stack products. Previously, systemd logged to the system journal or /var/log/kibana/kibana.stoud. Now both will log to the `/var/log/kibana/kibana.log'.

@jbudz jbudz changed the title [build] deb/rpm set logging.dest for packages" --no-verifu [build] deb/rpm set logging.dest for packages Aug 12, 2020
@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Aug 12, 2020

heh - ignore that. autopilot, of course i verify my commits

@jbudz jbudz marked this pull request as ready for review August 17, 2020 15:34
@jbudz jbudz requested a review from a team as a code owner August 17, 2020 15:34
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@tylersmalley
Copy link
Copy Markdown
Member

@jbudz, can you add the release note text per the format in https://www.elastic.co/guide/en/kibana/master/contributing.html#_create_the_release_notes_text

@tylersmalley
Copy link
Copy Markdown
Member

I am not seeing the logs - am I missing something?

tyler@tyler-ubuntu:~$ cat /etc/systemd/system/kibana.service
[Unit]
Description=Kibana

[Service]
Type=simple
User=kibana
Group=kibana
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/kibana
EnvironmentFile=-/etc/sysconfig/kibana
ExecStart=/usr/share/kibana/bin/kibana --logging.dest="/var/log/kibana/kibana.log"
Restart=on-failure
RestartSec=3
StartLimitBurst=3
StartLimitInterval=60
WorkingDirectory=/

[Install]
WantedBy=multi-user.target
tyler@tyler-ubuntu:~$ tail -f /var/log/kibana/kibana.log
tail: cannot open '/var/log/kibana/kibana.log' for reading: No such file or directory
tail: no files remaining

@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Aug 20, 2020

huh that's interesting - I think we lose all logs if there's a permission error. It might make more sense to redirect stdout to file..

@tylersmalley
Copy link
Copy Markdown
Member

Is this ready for another look?

@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Sep 8, 2020

@elasticmachine merge upstream

@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Sep 21, 2020

@elasticmachine merge upstream

@tylersmalley
Copy link
Copy Markdown
Member

I am fine with this approach since it's the current behavior for anyone using logging.dest

Copy link
Copy Markdown
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and LGTM. Please address the comment here. The docs here already say logs should goto /var/log/kibana unless there is another place I am missing which needs updated.

@tylersmalley
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

Copy link
Copy Markdown
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, spoke too soon - set_access is still being called for Red Hat in the post_install

fi

set_access
setup
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we no longer want to call this for Red Hat?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed with a2ba7f4. I haven't been able to get a build through pending the x-pack master failure, so not quite ready for testing yet. Will update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracking ^ at #81641

Copy link
Copy Markdown
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're no longer setting permissions for Red Hat:

$ ls -al /etc/kibana
total 24
drwxr-xr-x.  2 root root   44 Oct  5 22:14 .
drwxr-xr-x. 81 root root 8192 Oct  5 22:15 ..
-rw-r--r--.  1 root root 4818 Oct  5 20:28 kibana.yml
-rw-r--r--.  1 root root  216 Oct  5 20:28 node.options

vs expected on Ubuntu

$ sudo ls -al /etc/kibana
total 24
drwxr-s---  2 root kibana 4096 Sep 28 23:35 .
drwxr-xr-x 86 root root   4096 Sep 28 22:00 ..
-rw-r--r--  1 root kibana  130 Sep 28 23:35 kibana.keystore
-rw-rw----  1 root kibana 5194 Sep 28 18:40 kibana.yml
-rw-r--r--  1 root kibana  216 Sep 28 18:40 node.options

@jbudz jbudz changed the title [build] deb/rpm set logging.dest for packages [deb/rpm] set logging.dest Oct 27, 2020
Copy link
Copy Markdown
Member

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM tested both deb/RPM

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jbudz jbudz merged commit 2d49dea into elastic:master Oct 29, 2020
@jbudz jbudz deleted the package/logging_dest branch October 29, 2020 13:53
jbudz added a commit that referenced this pull request Oct 29, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@jbudz
Copy link
Copy Markdown
Contributor Author

jbudz commented Oct 29, 2020

7.x/7.11: 60813d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packages using systemd should log to /var/log/kibana

4 participants