Feature 07 · Study guide
Wire logs clients can trust, and expose health endpoints for probes.
from tpy.logging import get_logger
log = get_logger("app")
log.info("server started", host="127.0.0.1")
log.error("payment failed", order_id="ord_1")
By default you get console output and a file under storage/logs/. Channels: console, file, stack.
from tpy.logging import LogManager
manager = LogManager()
manager.configure(level="DEBUG", log_dir="storage/logs", app_name="myapp")
manager.channel("file").warning("only file")
| Path | Purpose |
|---|---|
GET /health | Process is up (liveness) |
GET /health/ready | Ready to take traffic (when Application mounts checks) |
Use these in Docker/Kubernetes probes or load balancer checks.
If you boot with Application(...).create() / mount(), logging and health helpers register with the app. Generated app/main.py still exposes a basic health route for soft-break projects.
More depth: Logging & Config.