Migrate Flask React template into Forge

This commit is contained in:
rob
2026-11-17 19:39:11 +00:00
parent bc6b6d26f1
commit 444406d2fc
109 changed files with 9427 additions and 13 deletions
@@ -0,0 +1,27 @@
"""Minimal structured application logging without request payloads."""
import json
import logging
from datetime import datetime, timezone
class JsonFormatter(logging.Formatter):
def format(self, record):
payload = {
"timestamp": datetime.now(timezone.utc).isoformat(),
"level": record.levelname,
"logger": record.name,
"message": record.getMessage(),
}
if record.exc_info:
payload["exception"] = self.formatException(record.exc_info)
return json.dumps(payload, ensure_ascii=False)
def configure_logging(app):
handler = logging.StreamHandler()
handler.setFormatter(JsonFormatter())
app.logger.handlers.clear()
app.logger.addHandler(handler)
app.logger.setLevel(app.config["LOG_LEVEL"])
app.logger.propagate = False