Logging
Enable request logging to inspect API and edge traces, latencies, and raw request/response data including prompts.
The 8080 API can record traces for your API and edge requests. Use them to understand latencies, inspect raw request and response payloads, and see prompts sent in each request.
What you get
Section titled “What you get”When logging is enabled for a request, 8080 records:
- Traces — End-to-end traces for API and edge requests
- Latency — Timing data to debug slow or variable response times
- Request and response data — Raw request body and response body
- Prompts — The full prompt (messages) included in the request
Traces are available in the 8080 dashboard so you can correlate requests with your application logs.
Enabling logging
Section titled “Enabling logging”Add "log": true to the JSON body of your request. Logging is supported on endpoints that accept a request body (for example, chat completions and responses).
Chat completions
Section titled “Chat completions”curl https://api.8080.io/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $_8080_API_KEY" \ -d '{ "model": "8080/taalas/llama3.1-8b-instruct", "messages": [{"role": "user", "content": "Hello"}], "log": true }'import requestsimport os
response = requests.post( "https://api.8080.io/v1/chat/completions", headers={ "Authorization": f"Bearer {os.environ.get('_8080_API_KEY')}", "Content-Type": "application/json", }, json={ "model": "8080/taalas/llama3.1-8b-instruct", "messages": [{"role": "user", "content": "Hello"}], "log": True, },)Responses endpoint
Section titled “Responses endpoint”For the responses API, include "log": true in the request body as well:
{ "template": "my-template", "inputs": { "name": "World" }, "log": true}Viewing traces
Section titled “Viewing traces”After sending requests with "log": true, open the dashboard and use the logging or traces section to filter by time range, endpoint, or request ID. You can expand each trace to see latency breakdowns, the full request (including messages/prompts), and the response payload.
Best practices
Section titled “Best practices”- Debugging — Turn on
log: truewhen diagnosing errors or unexpected behavior so you can see exactly what was sent and returned. - Sensitive data — Logged requests store the full prompt and response. Avoid enabling logging for requests that contain secrets or highly sensitive content, or use it only in non-production environments.
- Sampling — For high-volume traffic, enable logging only for a subset of requests (for example, on a percentage of calls or when a debug flag is set) to control volume and cost.