You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Russell McOrmond <Ru...@canadiana.ca> on 2016/02/27 14:09:30 UTC

CouchDB sending duplicate log entries to stdout/stderr (stored in upstart logs on Ubuntu)

We get our CouchDB from
https://launchpad.net/~couchdb/+archive/ubuntu/stable and are running
Ubuntu 14.04

We are using couchdb 1.6.1-0ubuntu5

We have noticed the following in email from Cron on many of our machines
nightly (we get many emails):

/etc/cron.daily/logrotate:
gzip: stdin: file size changed while zipping


The problem is with CouchDB stdout/stderr logging (Example output using -v)

considering log /var/log/upstart/couchdb.log
  log needs rotating
rotating log /var/log/upstart/couchdb.log, log->rotateCount is 7
dateext suffix '-20160227'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/upstart/couchdb.log.7.gz to
/var/log/upstart/couchdb.log.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/log/upstart/couchdb.log.6.gz to
/var/log/upstart/couchdb.log.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/upstart/couchdb.log.5.gz to
/var/log/upstart/couchdb.log.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/log/upstart/couchdb.log.4.gz to
/var/log/upstart/couchdb.log.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/upstart/couchdb.log.3.gz to
/var/log/upstart/couchdb.log.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/log/upstart/couchdb.log.2.gz to
/var/log/upstart/couchdb.log.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/upstart/couchdb.log.1.gz to
/var/log/upstart/couchdb.log.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/log/upstart/couchdb.log.0.gz to
/var/log/upstart/couchdb.log.1.gz (rotatecount 7, logstart 1, i 0),
old log /var/log/upstart/couchdb.log.0.gz does not exist
renaming /var/log/upstart/couchdb.log to /var/log/upstart/couchdb.log.1
compressing log with: /bin/gzip
switching uid to 0 and gid to 104
gzip: stdin: file size changed while zipping
removing old log /var/log/upstart/couchdb.log.8.gz
switching euid to 0 and egid to 0


Note that this is /var/log/upstart logs (logs of stdout, stderr from
CouchDB) and not the expected/desired logs in /var/log/couchdb/

What is being dumped in here is a duplicate of the same logs which are
being put in the logfile.

Searching I found a potential patch for this issue that I guess wasn't
accepted...
https://github.com/amatas/couchdb-centos/blob/master/couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch

And discussion in https://issues.apache.org/jira/browse/COUCHDB-2264
Note: I agree that using "-e" and "-o" to redirect stdout/stderr to
/dev/null isn't a good solution as there are things which should be going
to stdout/stderr, and a duplicate copy of logs going to /var/log/couchdb/*
isn't part of that.

I note there is discussion in this forum from 2010 about whether
"COUCHDB_STDOUT_FILE" should be set to /dev/null in /etc/defaults/couchdb ,
but that appears to be from before Upstart was used for startup.

Is there something we can do in our settings to correct this issue, or is
this a bug in CouchDB?  We don't want to have this duplication of logs, and
want to get CRON to stop spamming us each evening.

Is there at least a way to change the log level for that redundant
stdout/stderr logging separate from the output to the proper log files?


Thanks for any help.


-- 
System Administration and software developer,
Canadiana.org   http://www.canadiana.ca