---
title: Download Appium Log
slug: devicepark/sdk-documentation/sessions/download-appium-log
description: Download Appium logs for session troubleshooting.
docTags: 
createdAt: 2026-08-10T08:03:45.536Z
---

Use this method to download Appium server logs for troubleshooting a session. The SDK returns binary data rather than parsed text.

Use the log when a session fails to start, an Appium command fails or the device behavior differs from the test result.

## Before You Begin

Keep the `sessionId` returned by Start Session. Logs can be requested for the related session without manually creating a download URL.

## SDK Method

| Java                                                 | Node.js                                                    | .NET                                                          |
| ---------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------- |
| `client.sessions().logs(sessionId)` returns `byte[]` | `await client.sessions().logs(sessionId)` returns `Buffer` | `await client.Sessions.LogsAsync(sessionId)` returns `byte[]` |

## Request and Response Contract

| Item                      | Contract                    |
| ------------------------- | --------------------------- |
| Input                     | Required `sessionId` string |
| Request body              | None                        |
| Customer-supplied headers | None                        |
| Java result               | Binary `byte[]`             |
| Node.js result            | Binary `Buffer`             |

The result is not a JSON model. Write the returned bytes directly to a log file or pass them to a binary-safe storage system.

## Examples

:::CodeblockTabs
```java
byte[] logBytes = client.sessions().logs("session-123");
Files.write(Paths.get("appium.log"), logBytes);
```

```typescript
import { writeFile } from "node:fs/promises";

const logBuffer = await client.sessions().logs("session-123");
await writeFile("appium.log", logBuffer);
```

```csharp
var logBytes = await client.Sessions.LogsAsync("session-123");
await File.WriteAllBytesAsync("appium.log", logBytes);
```
:::

The log may not be available immediately while a session is still starting or finalizing. Preserve SDK error status and response body when reporting an unavailable artifact.

Do not render untrusted log content as HTML without escaping it.

## Next Step

After collecting required artifacts, [stop the session](docId\:BS_aoo0s5DDTONHvueqQr) and [release its allocation](docId\:zPik1KKbx0n9i3GXP3HoB) when no more sessions are planned.
