Observability
Logging
Access detailed API request logs. Integrate with your existing log management solution for unified observability.
Full request traces
Structured JSON
30-day retention
Log Levels
ERROR
Critical failures requiring attention
Example: Authentication failed, rate limit exceeded
WARN
Potential issues that may need attention
Example: Deprecated endpoint used, retry attempted
INFO
Standard operational events
Example: Request completed, webhook delivered
DEBUG
Detailed diagnostic information
Example: Cache hit, request routing details
Log Format
JSON Log Entry
{
"timestamp": "2024-12-15T14:32:45.123Z",
"level": "info",
"message": "API request completed",
"request_id": "req_abc123xyz",
"method": "POST",
"path": "/v1/valuations",
"status": 200,
"duration_ms": 127,
"org_id": "org_456",
"api_key_id": "ak_live_xxx",
"user_agent": "justkalm-python/2.0.0",
"ip_hash": "sha256:abc123...",
"response_size": 1847,
"cache_status": "MISS",
"region": "us-east-1"
}Standard Log Fields
| Field | Type | Description |
|---|---|---|
timestamp | string | ISO 8601 timestamp with timezone |
level | string | Log level (error, warn, info, debug) |
request_id | string | Unique request identifier for tracing |
method | string | HTTP method (GET, POST, etc.) |
path | string | Request path without query params |
status | number | HTTP response status code |
duration_ms | number | Request duration in milliseconds |
org_id | string | Organization identifier |
user_agent | string | Client user agent string |
ip | string | Client IP (hashed for privacy) |
Query Examples
Search and filter logs using structured queries:
Log Queries
# Search by request ID request_id:req_abc123xyz # Find errors in last hour level:error AND timestamp:[now-1h TO now] # Filter by organization org_id:org_456 AND status:>=400 # Slow requests duration_ms:>500 AND path:/v1/valuations* # Rate limit events message:"rate limit" AND level:warn # Aggregation query (Datadog/Splunk) source:justkalm | stats count by status | sort -count
Correlating Your Logs
Include the X-Request-Id from JustKalm responses in your application logs for end-to-end tracing.
Python Structured Logging
# Python - Structured logging with JustKalm correlation
import logging
import structlog
# Configure structured logging
structlog.configure(
processors=[
structlog.stdlib.filter_by_level,
structlog.stdlib.add_log_level,
structlog.stdlib.add_logger_name,
structlog.processors.TimeStamper(fmt="iso"),
structlog.processors.JSONRenderer()
],
)
logger = structlog.get_logger()
# Log with JustKalm request correlation
def call_justkalm_api(product_data):
try:
response = client.valuations.create(product_data)
# Log success with request ID
logger.info(
"valuation_created",
request_id=response.headers.get("X-Request-Id"),
valuation_id=response.id,
confidence=response.confidence,
duration_ms=response.headers.get("X-Response-Time")
)
return response
except JustKalmError as e:
# Log error with request ID for support
logger.error(
"valuation_failed",
request_id=e.request_id,
error_code=e.code,
error_message=str(e),
product_id=product_data.get("id")
)
raiseLog Retention
| Plan | Retention Period | Log Access | Export |
|---|---|---|---|
| Starter | 7 days | Dashboard only | — |
| Growth | 30 days | Dashboard + API | CSV, JSON |
| Scale | 90 days | Dashboard + API | CSV, JSON, S3 sync |
| Enterprise | Custom (up to 1 year) | Dashboard + API + SIEM | All formats + streaming |
Access Your Logs
View logs in the dashboard or integrate with your log management platform.