From c3c6a356d75fba8f390e25f40eb5e31fac68b9a1 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 17 May 2017 16:35:54 +0300 Subject: [PATCH 1/2] Cosmetic --- run-document-server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 3f42949..dec38df 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -139,7 +139,7 @@ create_postgresql_cluster(){ mv $postgresql_conf $postgresql_conf.backup mv $hba_conf $hba_conf.backup - + pg_createcluster ${PG_VERSION} ${PG_NAME} } @@ -203,7 +203,7 @@ update_nginx_settings(){ else cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_PATH} fi - + if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH} fi From dfceae252339ecf8e837c131d7d770f764f6ba86 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Wed, 17 May 2017 17:41:13 +0300 Subject: [PATCH 2/2] Added log level configuration parameter --- run-document-server.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/run-document-server.sh b/run-document-server.sh index dec38df..08c2027 100644 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -3,6 +3,7 @@ APP_DIR="/var/www/onlyoffice/documentserver" DATA_DIR="/var/www/onlyoffice/Data" LOG_DIR="/var/log/onlyoffice/documentserver" +CONF_DIR="/etc/onlyoffice/documentserver" ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false} ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost} @@ -27,9 +28,11 @@ NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-$(grep processor /proc/cpuinfo | wc -l)} NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} -ONLYOFFICE_DEFAULT_CONFIG=/etc/onlyoffice/documentserver/default.json +ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/default.json +ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}" +JSON_LOG="json -q -f ${ONLYOFFICE_LOG4JS_CONFIG}" LOCAL_SERVICES=() @@ -50,6 +53,8 @@ read_setting(){ REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)} REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-$(${JSON} services.CoAuthoring.redis.port)} + + DS_LOG_LEVEL=${DS_LOG_LEVEL:-$(${JSON_LOG} levels.nodeJS)} } parse_rabbitmq_url(){ @@ -216,6 +221,10 @@ update_supervisor_settings(){ cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf } +update_log_settings(){ + ${JSON_LOG} -I -e "this.levels.nodeJS = '${DS_LOG_LEVEL}'" +} + # create base folders for i in converter docservice spellchecker metrics gc; do mkdir -p "${LOG_DIR}/$i" @@ -227,6 +236,8 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then read_setting + update_log_settings + # update settings by env variables if [ ${POSTGRESQL_SERVER_HOST} != "localhost" ]; then update_postgresql_settings