logging, not print, from the first line of a service
print has no level, no timestamp, no module name, and no way to turn it off in production without editing code.
import logging
log = logging.getLogger(__name__)
log.info("order created", extra={"order_id": order.id})Configure the format and the handler once at startup. The JSON formatter for production is a five-line class or a dependency.
pythonobservability