Merge pull request #4302 from cloudskytian/staging Console access log output is now controlled by enableAccessLog

29702a3f1b25ca47bc09780f4edbca66341d0e2a

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
2 files changed, +2 -2Ignore whitespace
default/config.yaml+1 -1
@@ -100,7 +100,7 @@ disableCsrfProtection: false
100securityOverride: false100securityOverride: false
101# -- LOGGING CONFIGURATION --101# -- LOGGING CONFIGURATION --
102logging:102logging:
103 # Enable access logging to access.log file103 # Enable access logging to access.log file and console output
104 # Records new connections with timestamp, IP address and user agent104 # Records new connections with timestamp, IP address and user agent
105 enableAccessLog: true105 enableAccessLog: true
106 # Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)106 # Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)
src/middleware/accessLogWriter.js+1 -1
@@ -37,11 +37,11 @@ export default function accessLoggerMiddleware() {
3737
38 if (!knownIPs.has(clientIp)) {38 if (!knownIPs.has(clientIp)) {
39 // Log new connection39 // Log new connection
40 console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`));
41 knownIPs.add(clientIp);40 knownIPs.add(clientIp);
4241
43 // Write to access log if enabled42 // Write to access log if enabled
44 if (enableAccessLog) {43 if (enableAccessLog) {
44 console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`));
45 const logPath = getAccessLogPath();45 const logPath = getAccessLogPath();
46 const timestamp = new Date().toISOString();46 const timestamp = new Date().toISOString();
47 const log = `${timestamp} ${clientIp} ${userAgent}\n`;47 const log = `${timestamp} ${clientIp} ${userAgent}\n`;