Merge pull request #4302 from cloudskytian/staging Console access log output is now controlled by enableAccessLog
Signed| @@ -100,7 +100,7 @@ disableCsrfProtection: false | ||
| 100 | 100 | securityOverride: false |
| 101 | 101 | # -- LOGGING CONFIGURATION -- |
| 102 | 102 | logging: |
| 103 | 103 | # Enable access logging to access.log file and console output |
| 104 | 104 | # Records new connections with timestamp, IP address and user agent |
| 105 | 105 | enableAccessLog: true |
| 106 | 106 | # Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3) |
| @@ -37,11 +37,11 @@ export default function accessLoggerMiddleware() { | ||
| 37 | 37 | |
| 38 | 38 | if (!knownIPs.has(clientIp)) { |
| 39 | 39 | // Log new connection |
| 40 | - console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`)); | |
| 41 | 40 | knownIPs.add(clientIp); |
| 42 | 41 | |
| 43 | 42 | // Write to access log if enabled |
| 44 | 43 | if (enableAccessLog) { |
| 44 | + console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`)); | |
| 45 | 45 | const logPath = getAccessLogPath(); |
| 46 | 46 | const timestamp = new Date().toISOString(); |
| 47 | 47 | const log = `${timestamp} ${clientIp} ${userAgent}\n`; |