> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# logsSubscribe

> 트랜잭션 로깅 구독하기.

## 엔드포인트

Websockets는 다음 URL을 사용하여 mainnet 및 devnet에서 사용할 수 있습니다:

* **Mainnet** `wss://mainnet.helius-rpc.com/?api-key=<api-key>`
* **Devnet** `wss://devnet.helius-rpc.com/?api-key=<api-key>`

<Note>Websockets는 10분 비활성 타이머가 있으며, 웹소켓 연결을 유지하려면 상태 점검을 구현하고 매분 ping을 보내는 것이 강력히 권장됩니다.</Note>

## 권한

<ParamField query="api-key" type="string" required>
  귀하의 Helius API 키. [대시보드](https://dashboard.helius.dev/api-keys)에서 무료로 받을 수 있습니다.
</ParamField>

## 본문

<ParamField body="params" type="array" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="filter" type="string | object" required>
      계정 유형별로 결과를 받기 위한 로그 필터 기준입니다. 현재 지원되는 필터 유형은 다음과 같습니다:

      * `all` - 간단한 투표 트랜잭션을 제외한 모든 트랜잭션 구독
      * `allWithVotes` - 간단한 투표 트랜잭션을 포함한 모든 트랜잭션 구독
      * 다음 필드를 포함하는 JSON 객체:
        * `mentions: [ <string> ]` - 단일 Pubkey를 포함하는 배열(base-58로 인코딩된 문자열); 포함된 경우 이 주소를 언급하는 트랜잭션만 구독

      참고: 현재 `mentions` 필드는 메서드 호출당 하나의 Pubkey 문자열만 지원합니다. 추가 주소를 나열하면 오류가 발생합니다.
    </ParamField>

    <ParamField body="config" type="object">
      다음 필드를 포함하는 구성 객체:

      <ParamField body="commitment" type="string">
        구독의 커밋 수준입니다. `finalized`, `confirmed` 또는 `processed` 중에서 선택할 수 있습니다.
      </ParamField>
    </ParamField>
  </Expandable>
</ParamField>

## 응답

<ResponseField name="result" type="integer">
  구독 ID (구독 취소에 필요)
</ResponseField>

## 알림 형식

알림은 값이 다음과 같은 RpcResponse JSON 객체입니다:

* `signature: <string>` - 트랜잭션 서명 base58로 인코딩됨.
* `err: <object|null>` - 트랜잭션 실패 시 오류, 성공 시 null. TransactionError 정의를 참조하십시오.
* `logs: <array[string]>` - 실행 중 트랜잭션 명령의 출력 로그 메시지 배열.

<RequestExample>
  ```json Request theme={"system"}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "logsSubscribe",
    "params": [
      {
        "mentions": ["11111111111111111111111111111111"]
      },
      {
        "commitment": "finalized"
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"system"}
  {
    "jsonrpc": "2.0",
    "result": 24040,
    "id": 1
  }
  ```

  ```json Notification theme={"system"}
  {
    "jsonrpc": "2.0",
    "method": "logsNotification",
    "params": {
      "result": {
        "context": {
          "slot": 5208469
        },
        "value": {
          "signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
          "err": null,
          "logs": [
            "SBF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
          ]
        }
      },
      "subscription": 24040
    }
  }
  ```
</ResponseExample>
