This commit is contained in:
2025-10-05 22:29:22 +02:00
parent 85f2d2c6f7
commit 969533f1de
4 changed files with 16 additions and 10 deletions

View File

@@ -31,7 +31,7 @@ class Config:
"enable_console_logging": True,
"enable_console_progress": False,
"enable_fail2ban_logging": True,
"log_file": "aniworld.log",
"log_file": "./logs/aniworld.log",
"max_log_size_mb": 10,
"log_backup_count": 5
},

View File

@@ -36,7 +36,7 @@ logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('logs/aniworld.log'),
logging.FileHandler('./logs/aniworld.log'),
logging.StreamHandler()
]
)
@@ -57,7 +57,7 @@ class Settings(BaseSettings):
log_level: str = Field(default="INFO", env="LOG_LEVEL")
# Additional settings from .env
database_url: str = Field(default="sqlite:///./aniworld.db", env="DATABASE_URL")
database_url: str = Field(default="sqlite:///./data/aniworld.db", env="DATABASE_URL")
cors_origins: str = Field(default="*", env="CORS_ORIGINS")
api_rate_limit: int = Field(default=100, env="API_RATE_LIMIT")
default_provider: str = Field(default="aniworld.to", env="DEFAULT_PROVIDER")

View File

@@ -26,7 +26,11 @@ def get_logging_config():
'enable_console_logging': config.enable_console_logging,
'enable_console_progress': config.enable_console_progress,
'enable_fail2ban_logging': config.enable_fail2ban_logging,
'log_files': log_config.get_log_files() if hasattr(log_config, 'get_log_files') else []
'log_files': [
'./logs/aniworld.log',
'./logs/auth_failures.log',
'./logs/downloads.log'
]
}
return jsonify({
@@ -102,10 +106,12 @@ def list_log_files():
"""Get list of available log files."""
try:
from src.infrastructure.logging.GlobalLogger import error_logger
# Since we don't have log_config.get_log_files(), return basic log files
log_files = ["aniworld.log", "auth_failures.log", "downloads.log"]
# Return basic log files
log_files = [
'./logs/aniworld.log',
'./logs/auth_failures.log',
'./logs/downloads.log'
]
return jsonify({
'success': True,
'files': log_files