Share via


AgentAdministrationClient.GetSessionLogStream Method

Definition

Streams console logs (stdout / stderr) for a specific hosted agent session as a Server-Sent Events (SSE) stream. Each SSE frame contains:

  • `event`: always `"log"`
  • `data`: a plain-text log line (currently JSON-formatted, but the schema
is not contractual and may include additional keys or change format over time β€” clients should treat it as an opaque string) Example SSE frames: ``` event: log data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"} event: log data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} event: log data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} event: log data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} ``` The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed.
public virtual System.ClientModel.ClientResult<Azure.AI.Projects.Agents.SessionLogEvent> GetSessionLogStream(string agentName, string agentVersion, string sessionId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSessionLogStream : string * string * string * System.Threading.CancellationToken -> System.ClientModel.ClientResult<Azure.AI.Projects.Agents.SessionLogEvent>
override this.GetSessionLogStream : string * string * string * System.Threading.CancellationToken -> System.ClientModel.ClientResult<Azure.AI.Projects.Agents.SessionLogEvent>
Public Overridable Function GetSessionLogStream (agentName As String, agentVersion As String, sessionId As String, Optional cancellationToken As CancellationToken = Nothing) As ClientResult(Of SessionLogEvent)

Parameters

agentName
String

The name of the hosted agent.

agentVersion
String

The version of the agent.

sessionId
String

The session ID (maps to an ADC sandbox).

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

Exceptions

agentName, agentVersion or sessionId is null.

agentName, agentVersion or sessionId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to