From e4bb50b2b41903f4f9dd8da47d42c441fe5ab24d Mon Sep 17 00:00:00 2001 From: joe Date: Fri, 18 Sep 2020 03:39:58 +0000 Subject: [PATCH] Enabling access log options like an apache webserver to write user IP to log files. --- config.json | 1 + node_scripts/get-values-from-config-json.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/config.json b/config.json index 0730bfa..dcb090e 100644 --- a/config.json +++ b/config.json @@ -6,6 +6,7 @@ "socketCustomEvent": "RTCMultiConnection-Custom-Message", "port": "9001", "enableLogs": "false", + "enableAccessLogs": "false", "autoRebootServerOnFailure": "false", "isUseHTTPs": "false", "sslKey": "./fake-keys/privatekey.pem", diff --git a/node_scripts/get-values-from-config-json.js b/node_scripts/get-values-from-config-json.js index 398e2b8..d1d93d9 100644 --- a/node_scripts/get-values-from-config-json.js +++ b/node_scripts/get-values-from-config-json.js @@ -15,6 +15,7 @@ function getValues(param) { socketCustomEvent: 'RTCMultiConnection-Custom-Message', port: process.env.PORT || 9001, enableLogs: false, + enableAccessLogs: false, autoRebootServerOnFailure: false, isUseHTTPs: null, sslKey: null, @@ -69,6 +70,10 @@ function getValues(param) { result.enableLogs = true; } + if ((config.enableAccessLogs || '').toString() === 'true') { + result.enableAccessLogs = true; + } + if ((config.socketURL || '').toString().length) { result.socketURL = (config.socketURL || '').toString(); }