Monitoring & Logs
info
Learn how to monitor and log Fluvius Framework applications.
Logging
Structured Logging
import logging
import json
class JSONFormatter(logging.Formatter):
def format(self, record):
return json.dumps({
'timestamp': self.formatTime(record),
'level': record.levelname,
'message': record.getMessage(),
})
handler = logging.StreamHandler()
handler.setFormatter(JSONFormatter())
logging.root.addHandler(handler)
Monitoring
Health Checks
@app.get("/health")
async def health_check():
return {"status": "healthy"}
Next Steps
- Learn about Releases & Versioning
- Explore Environment Setup
- Check CI/CD Pipeline