diff options
author | Joan Touzet <wohali@atypical.net> | 2016-08-02 15:25:48 -0400 |
---|---|---|
committer | Joan Touzet <wohali@atypical.net> | 2016-08-02 15:32:25 -0400 |
commit | 7ab6f2fda9568fca85ca0080149131215d153a0e (patch) | |
tree | 2d0d7a0dbf50802e4f44c6db8a310915eecd372e | |
parent | 6415cd1702e16b8493c479af6ddca54ed2b44599 (diff) | |
download | couchdb-log-file-by-default.tar.gz |
Change default to log to a file, not stderrarchive/log-file-by-defaultlog-file-by-default
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.ps1 | 2 | ||||
-rw-r--r-- | rel/overlay/etc/default.ini | 3 |
3 files changed, 23 insertions, 4 deletions
@@ -22,6 +22,7 @@ basename=`basename $0` PACKAGE_AUTHOR_NAME="The Apache Software Foundation" # TEST=0 +LOG_FILE="./var/log/couchdb.log" WITH_CURL="false" WITH_FAUXTON=1 WITH_DOCS=1 @@ -43,7 +44,7 @@ Options: # --prefix=DIRECTORY set the installation prefix (defaults to $DEFAULT_PREFIX) # --databasedir DIRECTORY specify the data directory (defaults to /var/lib/couchdb) # --viewindexdir DIRECTORY specify the view directory (defaults to /var/lib/couchdb) - # --logdir DIRECTORY specify the log file (defaults to /var/log/couchdb.log) + --logfile FILENAME specify the log file (defaults to ./var/log/couchdb.log) -c | --with-curl request that couchjs is linked to cURL (default false) --disable-fauxton do not build Fauxton --disable-docs do not build any documentation or manpages @@ -138,12 +139,29 @@ parse_opts() { printf 'ERROR: "--user" requires a non-empty argument.\n' >&2 exit 1 ;; + --logfile) + if [ -n "$2" ]; then + eval LOG_FILE=$2 + shift 2 + continue + else + printf 'ERROR: "--logfile" requires a non-empty argument.\n' >&2 + exit 1 + fi + ;; + --logfile=?*) + eval LOG_FILE=${1#*=} + ;; + --logfile=) + printf 'ERROR: "--logfile" requires a non-empty argument.\n' >&2 + exit 1 + ;; --) # End of options shift break ;; -?*) - echo "WARNING: Unkonwn option '$1', ignoring" >&2 + echo "WARNING: Unknown option '$1', ignoring" >&2 shift ;; *) # Done diff --git a/configure.ps1 b/configure.ps1 index b9ed80587..1fa9292fc 100644 --- a/configure.ps1 +++ b/configure.ps1 @@ -136,7 +136,7 @@ $CouchDBConfig = @" {prefix, "."}. {data_dir, "./data"}. {view_index_dir, "./data"}. -{log_file, ""}. +{log_file, "./var/log/couchdb.log"}. {fauxton_root, "./share/www"}. {user, "$CouchDBUser"}. {node_name, "-name couchdb@localhost"}. diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini index 5eeb9389b..2cc5b61ee 100644 --- a/rel/overlay/etc/default.ini +++ b/rel/overlay/etc/default.ini @@ -402,7 +402,8 @@ min_file_size = 131072 ; here if you want to implement your own ; writer. See couch_log_writer.erl for ; more information on the (simple) API. -writer = stderr +writer = file +file = {{log_file}} ; Options for the file writer ; file = /path/to/couch.log |