logfile
This commit is contained in:
parent
85f2d2c6f7
commit
969533f1de
@ -66,7 +66,7 @@ class EnvironmentConfig:
|
||||
|
||||
# Logging
|
||||
LOG_LEVEL: str = os.getenv('LOG_LEVEL', 'INFO')
|
||||
LOG_FILE: str = os.getenv('LOG_FILE', 'logs/aniworld.log')
|
||||
LOG_FILE: str = os.getenv('LOG_FILE', './logs/aniworld.log')
|
||||
|
||||
@classmethod
|
||||
def get_database_config(cls) -> Dict[str, Any]:
|
||||
@ -196,7 +196,7 @@ MAX_CONCURRENT_DOWNLOADS=3
|
||||
|
||||
# Logging
|
||||
LOG_LEVEL=INFO
|
||||
LOG_FILE=logs/aniworld.log
|
||||
LOG_FILE=./logs/aniworld.log
|
||||
"""
|
||||
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
|
||||
@ -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
|
||||
},
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user