apache / couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
https://couchdb.apache.org/
Apache License 2.0
6.28k stars 1.03k forks source link

/var/log/couchdb/couchdb.log no longer written by default on RHEL 8 #5261

Closed jefferbrecht closed 1 month ago

jefferbrecht commented 1 month ago

Description

On older versions (i.e. 3.3.3) couchdb would write to /var/log/couchdb/couchdb.log by default. As of 3.4.x this no longer appears to be the case. This is specific to RHEL 8 (I can't repro this on other Linux distros).

Steps to Reproduce

[jefferbrecht@couchdb2 ~]$ cat install
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://couchdb.apache.org/repo/couchdb.repo
sudo yum install -y couchdb
cat << EOF > local.ini
[couchdb]
[couch_peruser]
[chttpd]
[httpd]
[chttpd_auth]
[ssl]
[vhosts]
[admins]
admin = otelp
EOF
sudo mv local.ini /opt/couchdb/etc/local.ini
sudo chown couchdb:couchdb /opt/couchdb/etc/local.ini
sudo chmod 0755 /opt/couchdb/etc/local.ini
sudo systemctl enable couchdb 
sudo systemctl restart couchdb

[jefferbrecht@couchdb2 ~]$ sudo bash install
...<truncated>...
Installed:
  couchdb-3.4.1-1.el8.x86_64                                                                                                                                                                                                                                                   

Complete!
Created symlink /etc/systemd/system/multi-user.target.wants/couchdb.service → /usr/lib/systemd/system/couchdb.service.

[jefferbrecht@couchdb2 ~]$ sudo cat /var/log/couchdb/couchdb.log
cat: /var/log/couchdb/couchdb.log: No such file or directory

[jefferbrecht@couchdb2 ~]$ sudo ls /var/log
audit  boot.log  btmp  chrony  cron  dnf.librepo.log  dnf.log  dnf.rpm.log  firewalld  hawkey.log  kdump.log  lastlog  maillog  messages  private  qemu-ga  secure  spooler  sssd  tuned  wtmp

[jefferbrecht@couchdb2 ~]$ sudo cat /var/log/messages | grep "Apache CouchDB"
Sep 27 16:03:05 couchdb2 systemd[1]: Started Apache CouchDB.
Sep 27 16:03:06 couchdb2 couchdb[30145]: [info] 2024-09-27T16:03:06.139728Z couchdb@127.0.0.1 <0.231.0> -------- Apache CouchDB 3.4.1 is starting.
Sep 27 16:03:06 couchdb2 couchdb[30145]: [info] 2024-09-27T16:03:06.229326Z couchdb@127.0.0.1 <0.231.0> -------- Apache CouchDB has started. Time to relax.
Sep 27 16:03:06 couchdb2 couchdb[30145]: [info] 2024-09-27T16:03:06.458724Z couchdb@127.0.0.1 <0.327.0> -------- Apache CouchDB has started. Time to relax.
Sep 27 16:03:06 couchdb2 couchdb[30145]: [info] 2024-09-27T16:03:06.459530Z couchdb@127.0.0.1 <0.327.0> -------- Apache CouchDB has started on http://127.0.0.1:5984/

Expected Behaviour

couchdb should write to /var/log/couchdb/couchdb.log by default

Your Environment

[jefferbrecht@couchdb2 ~]$ curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"3.4.1","git_sha":"f504e38a5","uuid":"5281f9398739edc80fc04692299c0db0","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
[jefferbrecht@couchdb2 ~]$ cat /etc/os-release 
NAME="Rocky Linux"
VERSION="8.10 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.10 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.10"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.10"

Additional Context

I couldn't find anything in the 3.4.x release notes about changes to log writer defaults.

rnewson commented 1 month ago

thank you, we are looking into this. This should not have changed.

rnewson commented 1 month ago

ok, so this was deliberate. https://github.com/apache/couchdb-pkg/commit/366942bb4ca42eafdf69b66471173686ef900631

In addition, since we're updating the RPM package, remove some of
deprecated/redundant settings needed for old CentOS-es:

  - Log to journald instead of a file

we should have called this out in release notes.

rnewson commented 1 month ago
--- a/rpm/SOURCES/10-filelog.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[log]
-writer = file
-file = /var/log/couchdb/couchdb.log
-level = info
jefferbrecht commented 1 month ago

Looks WAI then -- thanks for confirming!

janl commented 1 month ago

I’ve added this to the release blog post:

Heads up RHEL (and compatible) users: our .rpm convenience binaries have changed logging from /var/log/couchdb/couchdb.log to logging to journald directly.