wohali closed pull request #83: Ability to change log level by passing
COUCHDB_LOG_LEVEL
URL: https://github.com/apache/couchdb-docker/pull/83
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/1.7.1/docker-entrypoint.sh b/1.7.1/docker-entrypoint.sh
index c1c9f56..c10190e 100755
--- a/1.7.1/docker-entrypoint.sh
+++ b/1.7.1/docker-entrypoint.sh
@@ -36,6 +36,12 @@ if [ "$1" = 'couchdb' ]; then
chown couchdb:couchdb /usr/local/etc/couchdb/local.d/docker.ini
fi
+ if [ "$COUCHDB_LOG_LEVEL" ]; then
+ # Set log level
+ printf "[log]\nlevel = %s\n" "$COUCHDB_LOG_LEVEL" >>
/usr/local/etc/couchdb/local.d/docker.ini
+ chown couchdb:couchdb /usr/local/etc/couchdb/local.d/docker.ini
+ fi
+
printf "[httpd]\nport = %s\nbind_address = %s\n"
${COUCHDB_HTTP_PORT:=5984} ${COUCHDB_HTTP_BIND_ADDRESS:=0.0.0.0} >
/usr/local/etc/couchdb/local.d/bind_address.ini
chown couchdb:couchdb /usr/local/etc/couchdb/local.d/bind_address.ini
diff --git a/2.1.1/docker-entrypoint.sh b/2.1.1/docker-entrypoint.sh
index e03cd1a..b206591 100755
--- a/2.1.1/docker-entrypoint.sh
+++ b/2.1.1/docker-entrypoint.sh
@@ -50,6 +50,12 @@ if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
fi
+ if [ "$COUCHDB_LOG_LEVEL" ]; then
+ # Set log level
+ printf "[log]\nlevel = %s\n" "$COUCHDB_LOG_LEVEL" >>
/opt/couchdb/etc/local.d/docker.ini
+ chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ fi
+
# if we don't find an [admins] section followed by a non-comment,
display a warning
if ! grep -Pzoqr '\[admins\]\n[^;]\w+' /opt/couchdb/etc/default.d/*.ini
/opt/couchdb/etc/local.d/*.ini; then
# The - option suppresses leading tabs but *not* spaces. :)
diff --git a/README.md b/README.md
index ef684ec..4acbb23 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,7 @@ In addition, a few environment variables are provided to set
very common paramet
* `COUCHDB_USER` and `COUCHDB_PASSWORD` will create an ini-file based local
admin user with the given username and password in the file
`/opt/couchdb/etc/local.d/docker.ini`.
* `COUCHDB_SECRET` will set the CouchDB shared cluster secret value, in the
file `/opt/couchdb/etc/local.d/docker.ini`.
+* `COUCHDB_LOG_LEVEL` will set the specified log level, in the file
`/opt/couchdb/etc/local.d/docker.ini`.
* `NODENAME` will set the name of the CouchDB node inside the container to
`couchdb@${NODENAME}`, in the file `/opt/couchdb/etc/vm.args`. This is used for
clustering purposes and can be ignored for single-node setups.
If other configuration settings are desired, externally mount
`/opt/couchdb/etc` and provide `.ini` configuration files under the
`/opt/couchdb/etc/local.d` directory.
diff --git a/dev/docker-entrypoint.sh b/dev/docker-entrypoint.sh
index 718779e..0af0694 100755
--- a/dev/docker-entrypoint.sh
+++ b/dev/docker-entrypoint.sh
@@ -49,6 +49,12 @@ if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
chown -f couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini ||
true
fi
+ if [ "$COUCHDB_LOG_LEVEL" ]; then
+ # Set log level
+ printf "[log]\nlevel = %s\n" "$COUCHDB_LOG_LEVEL" >>
/opt/couchdb/etc/local.d/docker.ini
+ chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ fi
+
# if we don't find an [admins] section followed by a non-comment,
display a warning
if ! grep -Pzoqr '\[admins\]\n[^;]\w+' /opt/couchdb/etc/local.d/*.ini;
then
# The - option suppresses leading tabs but *not* spaces. :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services