Skip to content

Log Streaming

The log streaming endpoint allows you to access the stdout and stderr output from your game server containers. This is invaluable for debugging issues, monitoring game server behavior, and gathering runtime information.

GET /logs
ParameterTypeRequiredDescription
idstringYesThe unique ID of the session you want logs from
followbooleanNoWhether to keep the stream open for new log entries (default: false)
GET /logs?id=c595bc6f-8522-4a62-95cd-8742136643ea&follow=true HTTP/1.1
Host: api.gameye.io
Authorization: Bearer YOUR_TOKEN_HERE

On success, you’ll receive a 200 OK response with the log output as a text stream:

2023-04-01T12:00:00Z [INFO] Game server starting...
2023-04-01T12:00:01Z [INFO] Loading map: de_dust2
2023-04-01T12:00:02Z [INFO] Waiting for players to connect...
2023-04-01T12:01:15Z [INFO] Player connected: Player1
2023-04-01T12:01:30Z [INFO] Player connected: Player2
...
Status CodeDescription
401Unauthorized - Invalid bearer token
404Not Found - Session doesn’t exist
{
"statusCode": 404,
"code": "RESOURCE_NOT_FOUND",
"message": "That session doesn't seem to exist.",
"details": "Double-check the ID.",
"identifier": "3bc545b7-4750-47e6-a918-c93debc58663",
"path": "/logs",
"timestamp": "2023-04-01T12:00:00Z"
}

🔍 Tip: Always include the identifier when contacting support about errors. This helps us quickly trace the exact issue in our systems.

To get all available logs up to the current moment:

GET /logs?id=c595bc6f-8522-4a62-95cd-8742136643ea HTTP/1.1

This will return all logs that the container has written to stdout/stderr so far and then close the connection.

To keep the connection open and receive new log entries as they occur:

GET /logs?id=c595bc6f-8522-4a62-95cd-8742136643ea&follow=true HTTP/1.1

This is useful for real-time monitoring of game server activity.

Two options are available for accessing logs:

  1. Session logs API endpoint (standard method)
    • Described in this document
    • Simple streaming of container logs
    • Suitable for most use cases
  2. Elastic-based solution (advanced)
    • Real-time log access with advanced search capabilities
    • Indexed and searchable logs
    • Advanced filtering and analysis options
    • Contact support for access to this feature

When players report problems, you can stream logs to:

  • Identify error messages
  • See warning signs
  • Track down the source of the issue

Real-time log streaming can help you:

  • See player connections and disconnections
  • Monitor match progress
  • Track game events

Logs can provide insights about:

  • Server performance
  • Resource usage
  • Configuration issues
  1. Stream Management - For long-running streams with follow=true, implement proper timeout and reconnection logic in your client
  2. Log Parsing - Consider implementing a log parser to extract structured data from the log stream
  3. Sequential Analysis - For debugging complex issues, first get historical logs, then keep the stream open for follow-up activities
  4. Log Retention - Remember that logs are only available while the session is running and shortly after it stops
  5. Consider Elastic Logging - For advanced use cases, ask about our Elastic-based logging solution
import requests
# Stream logs with follow mode
response = requests.get(
"https://api.gameye.io/logs",
params={"id": "c595bc6f-8522-4a62-95cd-8742136643ea", "follow": True},
headers={"Authorization": "Bearer YOUR_TOKEN_HERE"},
stream=True # Important for handling streaming responses
)
# Process the log stream
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
print(decoded_line)
# Process log line here

For web applications, you might want to:

  1. Fetch logs on demand when an admin views a session
  2. Display logs in a scrollable, searchable interface
  3. Highlight errors and warnings
  4. Allow filtering by log level or keywords