prod azure 1.0.4
This commit is contained in:
parent
5531519eb2
commit
da2983c5a2
4 changed files with 28 additions and 18 deletions
16
app.py
16
app.py
|
|
@ -18,22 +18,22 @@ from modules.configuration import APP_CONFIG
|
|||
|
||||
def initLogging():
|
||||
# Get log level from config (default to INFO if not found)
|
||||
logLevelName = APP_CONFIG.get("Logging_LOG_LEVEL", "WARNING")
|
||||
logLevelName = APP_CONFIG.get("APP_LOGGING_LOG_LEVEL", "WARNING")
|
||||
logLevel = getattr(logging, logLevelName)
|
||||
|
||||
# Configure handlers based on config
|
||||
handlers = []
|
||||
|
||||
# Add console handler if enabled
|
||||
if APP_CONFIG.get("Logging_CONSOLE_ENABLED", True):
|
||||
if APP_CONFIG.get("APP_LOGGING_CONSOLE_ENABLED", True):
|
||||
consoleHandler = logging.StreamHandler()
|
||||
handlers.append(consoleHandler)
|
||||
|
||||
# Add file handler if enabled
|
||||
if APP_CONFIG.get("Logging_FILE_ENABLED", True):
|
||||
logFile = APP_CONFIG.get("Logging_LOG_FILE", "app.log")
|
||||
rotationSize = int(APP_CONFIG.get("Logging_ROTATION_SIZE", 10485760)) # Default: 10MB
|
||||
backupCount = int(APP_CONFIG.get("Logging_BACKUP_COUNT", 5))
|
||||
if APP_CONFIG.get("APP_LOGGING_FILE_ENABLED", True):
|
||||
logFile = APP_CONFIG.get("APP_LOGGING_LOG_FILE", "app.log")
|
||||
rotationSize = int(APP_CONFIG.get("APP_LOGGING_ROTATION_SIZE", 10485760)) # Default: 10MB
|
||||
backupCount = int(APP_CONFIG.get("APP_LOGGING_BACKUP_COUNT", 5))
|
||||
|
||||
fileHandler = RotatingFileHandler(
|
||||
logFile,
|
||||
|
|
@ -45,8 +45,8 @@ def initLogging():
|
|||
# Configure the logger
|
||||
logging.basicConfig(
|
||||
level=logLevel,
|
||||
format=APP_CONFIG.get("Logging_FORMAT", "%(asctime)s - %(levelname)s - %(name)s - %(message)s"),
|
||||
datefmt=APP_CONFIG.get("Logging_DATE_FORMAT", "%Y-%m-%d %H:%M:%S"),
|
||||
format=APP_CONFIG.get("APP_LOGGING_FORMAT", "%(asctime)s - %(levelname)s - %(name)s - %(message)s"),
|
||||
datefmt=APP_CONFIG.get("APP_LOGGING_DATE_FORMAT", "%Y-%m-%d %H:%M:%S"),
|
||||
handlers=handlers
|
||||
)
|
||||
|
||||
|
|
|
|||
10
config.ini
10
config.ini
|
|
@ -23,16 +23,6 @@ Connector_AiAnthropic_MAX_TOKENS = 2000
|
|||
File_Management_MAX_UPLOAD_SIZE_MB = 50
|
||||
File_Management_CLEANUP_INTERVAL = 240
|
||||
|
||||
# Logging configuration
|
||||
Logging_LOG_LEVEL = DEBUG
|
||||
Logging_LOG_FILE = poweron.log
|
||||
Logging_FORMAT = %(asctime)s - %(levelname)s - %(name)s - %(message)s
|
||||
Logging_DATE_FORMAT = %Y-%m-%d %H:%M:%S
|
||||
Logging_CONSOLE_ENABLED = True
|
||||
Logging_FILE_ENABLED = True
|
||||
Logging_ROTATION_SIZE = 10485760
|
||||
Logging_BACKUP_COUNT = 5
|
||||
|
||||
# Security configuration (for future use)
|
||||
Security_PASSWORD_MIN_LENGTH = 8
|
||||
Security_PASSWORD_REQUIRE_UPPERCASE = True
|
||||
|
|
|
|||
10
env_dev.env
10
env_dev.env
|
|
@ -23,3 +23,13 @@ APP_TOKEN_EXPIRY=300
|
|||
|
||||
# CORS Configuration
|
||||
APP_ALLOWED_ORIGINS=http://localhost:8080,https://playground.poweron-center.net
|
||||
|
||||
# Logging configuration
|
||||
APP_LOGGING_LOG_LEVEL = DEBUG
|
||||
APP_LOGGING_LOG_FILE = poweron.log
|
||||
APP_LOGGING_FORMAT = %(asctime)s - %(levelname)s - %(name)s - %(message)s
|
||||
APP_LOGGING_DATE_FORMAT = %Y-%m-%d %H:%M:%S
|
||||
APP_LOGGING_CONSOLE_ENABLED = True
|
||||
APP_LOGGING_FILE_ENABLED = True
|
||||
APP_LOGGING_ROTATION_SIZE = 10485760
|
||||
APP_LOGGING_BACKUP_COUNT = 5
|
||||
10
env_prod.env
10
env_prod.env
|
|
@ -23,3 +23,13 @@ APP_TOKEN_EXPIRY=300
|
|||
|
||||
# CORS Configuration
|
||||
APP_ALLOWED_ORIGINS=http://localhost:8080,https://playground.poweron-center.net
|
||||
|
||||
# Logging configuration
|
||||
APP_LOGGING_LOG_LEVEL = DEBUG
|
||||
APP_LOGGING_LOG_FILE = /home/poweron.log
|
||||
APP_LOGGING_FORMAT = %(asctime)s - %(levelname)s - %(name)s - %(message)s
|
||||
APP_LOGGING_DATE_FORMAT = %Y-%m-%d %H:%M:%S
|
||||
APP_LOGGING_CONSOLE_ENABLED = True
|
||||
APP_LOGGING_FILE_ENABLED = True
|
||||
APP_LOGGING_ROTATION_SIZE = 10485760
|
||||
APP_LOGGING_BACKUP_COUNT = 5
|
||||
Loading…
Reference in a new issue