Use json.dumps()
to log a proper JSON object:
import logging
import json
import logging
import json
dict1 = {"abc": "123", "cdf": "345"}
LOGGER.info(json.dumps(dict1))
# ✅ logs as valid JSON for Snowflake VARIANT
This ensures the log is stored as a JSON object in Snowflake, not a plain string.