Move minLogLevel to logging section

This commit is contained in:
Cohee
2025-02-22 13:58:08 +02:00
parent b12cd9fe05
commit a2ecb81378
3 changed files with 8 additions and 3 deletions

View File

@@ -71,8 +71,6 @@ autheliaAuth: false
# the username and passwords for basic auth are the same as those # the username and passwords for basic auth are the same as those
# for the individual accounts # for the individual accounts
perUserBasicAuth: false perUserBasicAuth: false
# Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)
minLogLevel: 0
# User session timeout *in seconds* (defaults to 24 hours). # User session timeout *in seconds* (defaults to 24 hours).
## Set to a positive number to expire session after a certain time of inactivity ## Set to a positive number to expire session after a certain time of inactivity
@@ -90,6 +88,8 @@ logging:
# Enable access logging to access.log file # Enable access logging to access.log file
# Records new connections with timestamp, IP address and user agent # Records new connections with timestamp, IP address and user agent
enableAccessLog: true enableAccessLog: true
# Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)
minLogLevel: 0
# -- RATE LIMITING CONFIGURATION -- # -- RATE LIMITING CONFIGURATION --
rateLimiting: rateLimiting:
# Use X-Real-IP header instead of socket IP for rate limiting # Use X-Real-IP header instead of socket IP for rate limiting

View File

@@ -104,6 +104,11 @@ const keyMigrationMap = [
newKey: 'extensions.models.textToSpeech', newKey: 'extensions.models.textToSpeech',
migrate: (value) => value, migrate: (value) => value,
}, },
{
oldKey: 'minLogLevel',
newKey: 'logging.minLogLevel',
migrate: (value) => value,
},
]; ];
/** /**

View File

@@ -763,7 +763,7 @@ export function stringToBool(str) {
* Setup the minimum log level * Setup the minimum log level
*/ */
export function setupLogLevel() { export function setupLogLevel() {
const logLevel = getConfigValue('minLogLevel', LOG_LEVELS.DEBUG); const logLevel = getConfigValue('logging.minLogLevel', LOG_LEVELS.DEBUG);
globalThis.console.debug = logLevel <= LOG_LEVELS.DEBUG ? console.debug : () => {}; globalThis.console.debug = logLevel <= LOG_LEVELS.DEBUG ? console.debug : () => {};
globalThis.console.info = logLevel <= LOG_LEVELS.INFO ? console.info : () => {}; globalThis.console.info = logLevel <= LOG_LEVELS.INFO ? console.info : () => {};