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():
|
def initLogging():
|
||||||
# Get log level from config (default to INFO if not found)
|
# 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)
|
logLevel = getattr(logging, logLevelName)
|
||||||
|
|
||||||
# Configure handlers based on config
|
# Configure handlers based on config
|
||||||
handlers = []
|
handlers = []
|
||||||
|
|
||||||
# Add console handler if enabled
|
# 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()
|
consoleHandler = logging.StreamHandler()
|
||||||
handlers.append(consoleHandler)
|
handlers.append(consoleHandler)
|
||||||
|
|
||||||
# Add file handler if enabled
|
# Add file handler if enabled
|
||||||
if APP_CONFIG.get("Logging_FILE_ENABLED", True):
|
if APP_CONFIG.get("APP_LOGGING_FILE_ENABLED", True):
|
||||||
logFile = APP_CONFIG.get("Logging_LOG_FILE", "app.log")
|
logFile = APP_CONFIG.get("APP_LOGGING_LOG_FILE", "app.log")
|
||||||
rotationSize = int(APP_CONFIG.get("Logging_ROTATION_SIZE", 10485760)) # Default: 10MB
|
rotationSize = int(APP_CONFIG.get("APP_LOGGING_ROTATION_SIZE", 10485760)) # Default: 10MB
|
||||||
backupCount = int(APP_CONFIG.get("Logging_BACKUP_COUNT", 5))
|
backupCount = int(APP_CONFIG.get("APP_LOGGING_BACKUP_COUNT", 5))
|
||||||
|
|
||||||
fileHandler = RotatingFileHandler(
|
fileHandler = RotatingFileHandler(
|
||||||
logFile,
|
logFile,
|
||||||
|
|
@ -45,8 +45,8 @@ def initLogging():
|
||||||
# Configure the logger
|
# Configure the logger
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logLevel,
|
level=logLevel,
|
||||||
format=APP_CONFIG.get("Logging_FORMAT", "%(asctime)s - %(levelname)s - %(name)s - %(message)s"),
|
format=APP_CONFIG.get("APP_LOGGING_FORMAT", "%(asctime)s - %(levelname)s - %(name)s - %(message)s"),
|
||||||
datefmt=APP_CONFIG.get("Logging_DATE_FORMAT", "%Y-%m-%d %H:%M:%S"),
|
datefmt=APP_CONFIG.get("APP_LOGGING_DATE_FORMAT", "%Y-%m-%d %H:%M:%S"),
|
||||||
handlers=handlers
|
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_MAX_UPLOAD_SIZE_MB = 50
|
||||||
File_Management_CLEANUP_INTERVAL = 240
|
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 configuration (for future use)
|
||||||
Security_PASSWORD_MIN_LENGTH = 8
|
Security_PASSWORD_MIN_LENGTH = 8
|
||||||
Security_PASSWORD_REQUIRE_UPPERCASE = True
|
Security_PASSWORD_REQUIRE_UPPERCASE = True
|
||||||
|
|
|
||||||
10
env_dev.env
10
env_dev.env
|
|
@ -23,3 +23,13 @@ APP_TOKEN_EXPIRY=300
|
||||||
|
|
||||||
# CORS Configuration
|
# CORS Configuration
|
||||||
APP_ALLOWED_ORIGINS=http://localhost:8080,https://playground.poweron-center.net
|
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
|
# CORS Configuration
|
||||||
APP_ALLOWED_ORIGINS=http://localhost:8080,https://playground.poweron-center.net
|
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