diff --git a/default/config.yaml b/default/config.yaml index 6965d8b35..bdc25006d 100644 --- a/default/config.yaml +++ b/default/config.yaml @@ -100,7 +100,7 @@ disableCsrfProtection: false securityOverride: false # -- LOGGING CONFIGURATION -- logging: - # Enable access logging to access.log file + # Enable access logging to access.log file and console output # Records new connections with timestamp, IP address and user agent enableAccessLog: true # Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3) diff --git a/src/middleware/accessLogWriter.js b/src/middleware/accessLogWriter.js index 4aaeeb5a6..9451dabc1 100644 --- a/src/middleware/accessLogWriter.js +++ b/src/middleware/accessLogWriter.js @@ -37,11 +37,11 @@ export default function accessLoggerMiddleware() { if (!knownIPs.has(clientIp)) { // Log new connection - console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`)); knownIPs.add(clientIp); // Write to access log if enabled if (enableAccessLog) { + console.info(color.yellow(`New connection from ${clientIp}; User Agent: ${userAgent}\n`)); const logPath = getAccessLogPath(); const timestamp = new Date().toISOString(); const log = `${timestamp} ${clientIp} ${userAgent}\n`;