955bc9a7bf
- auth/login.py: guard against missing JSON body (get_json silent=True, empty-string check) - app.py: replace infinite redirect with 404 for unknown /api/* and /setup/* paths - tools/jwtdecoder.py: add algorithms list to jwt.decode() for PyJWT 2.x compatibility - util/setup_routes.py: call reset_pool() after save_config() so pool re-initialises with new DB credentials - util/logger.py: set ERROR level on error.log handler so it no longer receives INFO/WARNING messages - LoginForm.jsx: remove dead navigate() call that was immediately overridden by window.location.href - main.jsx: remove base.css, dark.css, light.css that were already imported in App.jsx (duplicate imports) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
424 B
Python
22 lines
424 B
Python
import logging
|
|
import os
|
|
|
|
os.makedirs("logs", exist_ok=True)
|
|
|
|
fmt = "%(asctime)s [%(levelname)s] %(message)s"
|
|
|
|
error_handler = logging.FileHandler("logs/error.log")
|
|
error_handler.setLevel(logging.ERROR)
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format=fmt,
|
|
handlers=[
|
|
logging.FileHandler("logs/app.log"),
|
|
error_handler,
|
|
logging.StreamHandler()
|
|
]
|
|
)
|
|
|
|
logger = logging.getLogger("main")
|