> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-mason-add-copy-page-to-context-menu.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Logs

## Via API

After you [invoke](/apps/invoke) an action, you can stream the invocation's logs in real time:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import { Kernel } from '@onkernel/sdk';

  const kernel = new Kernel();

  const logs = await kernel.invocations.follow(invocation_id);
  ```

  ```python Python theme={null}
  import kernel

  client = Kernel()

  logs = client.invocations.follow(invocation_id)
  ```
</CodeGroup>

## Via CLI

You can also stream the logs to your terminal via the CLI:

```bash theme={null}
kernel logs <app_name> --follow
```

If you don't specify `--follow`, the logs will print to the terminal until 3 seconds of inactivity and then stops.

You can get logs for a specific invocation by adding:

```
-i --invocation <invocation id>    Show logs for a specific invocation of the app.
```
