Merge pull request #4302 from cloudskytian/staging

Console access log output is now controlled by enableAccessLog
This commit is contained in:
Cohee
2025-07-25 22:02:27 +03:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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`;