[couchdb/f20] Instead print the log filename to stdout, in case a user who ran it from the CLI is confused abo
Warren Togami
wtogami at fedoraproject.org
Thu Jul 3 12:59:28 UTC 2014
commit e78e50661e36236eee283a50381fec6e23769f26
Author: Warren Togami <wtogami at gmail.com>
Date: Thu Jul 3 02:58:58 2014 -1000
Instead print the log filename to stdout, in case a user who ran it
from the CLI is confused about where the messages went.
- -couch_ini accepts .ini or a .d/ directory. For directories it reads
any *.ini file. Fixes #1002277.
...ilence-redundant-logging-to-stdout-stderr.patch | 32 ++++++++++++++++----
couchdb.service | 2 +-
couchdb.spec | 10 +++++-
3 files changed, 35 insertions(+), 9 deletions(-)
---
diff --git a/couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch b/couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch
index 5b6fc36..b0c28f6 100644
--- a/couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch
+++ b/couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch
@@ -1,18 +1,19 @@
-From 590ea6ed73126f520d5fd06297f32810bd59a968 Mon Sep 17 00:00:00 2001
+From 50f4c9cc273790d4e4ed6bd93f1272e7d399eba0 Mon Sep 17 00:00:00 2001
From: Warren Togami <wtogami at gmail.com>
Date: Wed, 2 Jul 2014 22:54:38 -1000
-Subject: [PATCH 11/11] Silence redundant logging to stdout/stderr
+Subject: [PATCH 11/12] Silence redundant logging to stdout/stderr
+
+Instead print log filename to stdout during startup.
CouchDB already logs everything to /var/log/couchdb/couch.log.
The stdout/stderr redundantly floods /var/log/messages.
-
This temporary hack was suggested by rnewson in #couchdb.
-
https://issues.apache.org/jira/browse/COUCHDB-2264
Related issue
---
- src/couchdb/couch_log.erl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/couchdb/couch_log.erl | 2 +-
+ src/couchdb/couch_server_sup.erl | 6 ++++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/couchdb/couch_log.erl b/src/couchdb/couch_log.erl
index cd4bbbb..db483a7 100644
@@ -27,6 +28,25 @@ index cd4bbbb..db483a7 100644
ok = io:put_chars(Fd, FileMsg).
get_log_messages(Pid, Level, Format, Args) ->
+diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl
+index be3c3a3..39a5568 100644
+--- a/src/couchdb/couch_server_sup.erl
++++ b/src/couchdb/couch_server_sup.erl
+@@ -56,10 +56,12 @@ start_server(IniFiles) ->
+ {ok, ConfigPid} = couch_config:start_link(IniFiles),
+
+ LogLevel = couch_config:get("log", "level", "info"),
++ LogFileName = couch_config:get("log", "file"),
+ % announce startup
+- io:format("Apache CouchDB ~s (LogLevel=~s) is starting.~n", [
++ io:format("Apache CouchDB ~s (LogLevel=~s) is logging to ~s.~n", [
+ couch_server:get_version(),
+- LogLevel
++ LogLevel,
++ LogFileName
+ ]),
+ case LogLevel of
+ "debug" ->
--
1.9.3
diff --git a/couchdb.service b/couchdb.service
index 410e3a0..924e13e 100644
--- a/couchdb.service
+++ b/couchdb.service
@@ -12,7 +12,7 @@ Restart=always
StartLimitInterval=10
StartLimitBurst=5
PIDFile=/var/run/couchdb/couchdb.pid
-ExecStart=/usr/bin/erl +Bd -noinput -sasl errlog_type error +K true +A 4 -couch_ini /etc/couchdb/default.ini /etc/couchdb/local.ini -s couch -pidfile /var/run/couchdb/couchdb.pid -heart
+ExecStart=/usr/bin/erl +Bd -noinput -sasl errlog_type error +K true +A 4 -couch_ini /etc/couchdb/default.ini /etc/couchdb/default.d/ /etc/couchdb/local.ini /etc/couchdb/local.d/ -s couch -pidfile /var/run/couchdb/couchdb.pid -heart
[Install]
WantedBy=multi-user.target
diff --git a/couchdb.spec b/couchdb.spec
index 69998d1..6dd09e9 100644
--- a/couchdb.spec
+++ b/couchdb.spec
@@ -8,7 +8,7 @@
Name: couchdb
Version: 1.6.0
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: A document database server, accessible via a RESTful JSON API
Group: Applications/Databases
@@ -30,6 +30,7 @@ Patch8: couchdb-0008-Fix-for-Erlang-R16B01.patch
Patch9: couchdb-0009-README-was-renamed.patch
Patch10: couchdb-0010-Use-_DEFAULT_SOURCE-instead-of-obsolete-_BSD_SOURCE.patch
Patch11: couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch
+Patch12: couchdb-0012-Allow-passing-directories-as-the-config-sources.patch
BuildRequires: autoconf
BuildRequires: autoconf-archive
@@ -110,6 +111,7 @@ JavaScript acting as the default view definition language.
%patch10 -p1 -b .default_instead_of_bsd
%endif
%patch11 -p1 -b .redundant_logging
+%patch12 -p1 -b .ini_dirs
#gzip -d -k ./share/doc/build/latex/CouchDB.pdf.gz
# Remove bundled libraries
@@ -233,9 +235,13 @@ fi
%changelog
-* Wed Jul 02 2014 Warren Togami <wtogami at gmail.com> - 1.6.0-3
+* Wed Jul 02 2014 Warren Togami <wtogami at gmail.com> - 1.6.0-4
- silence stdout/stderr to prevent redundant flooding of /var/log/messages
CouchDB already logs these messages to /var/log/couchdb/couch.log
+ Instead print the log filename to stdout, in case a user who ran it
+ from the CLI is confused about where the messages went.
+- -couch_ini accepts .ini or a .d/ directory. For directories it reads
+ any *.ini file. Fixes #1002277.
* Mon Jun 23 2014 Peter Lemenkov <lemenkov at gmail.com> - 1.6.0-2
- Fix building with sligntly older gcc/glibc
More information about the scm-commits
mailing list