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

# July 2, 2024

<Frame>
  <img src="https://mintcdn.com/slai-beam/8ZCK4GhQQmQigFR0/img/releases/changelog-72.jpg?fit=max&auto=format&n=8ZCK4GhQQmQigFR0&q=85&s=7d0e4bab4d93d82126c9a946be2bfde9" width="2400" height="1350" data-path="img/releases/changelog-72.jpg" />
</Frame>

# `0.2.43`

* Added `beam logs` command to stream logs to a local shell
* Added custom timeouts for serves
* Added `env.is_remote()` to avoid import errors when running Beam apps locally
* [Signup for Beam V2 without a waitlist](https://platform.beam.cloud)

<Info>
  Upgrade to the latest CLI:

  ```sh theme={null}
  uv tool upgrade beam-client
  ```
</Info>

## Stream Remote Logs with `beam logs`

To simplify remote debugging, you can now stream logs from a task, deployment, or a container directly to your shell.

### Deployment

Streams logs for a deployment.

```bash theme={null}
beam logs --deployment-id [DEPLOYMENT-ID]
```

You can find the deployment ID by running `beam deployment list`.

```bash theme={null}
$ beam logs --deployment-id 2089b5b5-9b2a-450e-9a56-a50d4f0a8d4c

Starting task worker[0]
Worker[0] ready
Running task <25156946-2c3a-4900-8a2c-568f162493a7>
Task completed <25156946-2c3a-4900-8a2c-568f162493a7>, took 3.4570693s
Spinning down taskqueue
```

### Task

Streams logs for a task.

```bash theme={null}
beam logs --task-id [TASK-ID]
```

You can find the task ID by running `beam task list`.

### Container

Streams logs for a container.

```bash theme={null}
beam logs --container-id [CONTAINER-ID]
```

You can find the container ID by running `beam container list`.

## Set Custom Timeouts for `beam serve`

You can configure how long to keep your serve session connected with the `--timeout` flag.

```bash theme={null}
beam serve file.py:func --timeout 300
```

* Timeout value of 0 will use the default timeout
* Timeout value of -1 will remove the timeout and persist the container for as long as the user is connected

## Manage Remote Imports with `env.is_remote()`

Typically, your apps that run on Beam will be using packages that you don't have installed locally.

If your Beam app uses packages that aren't installed locally, you'll need to ensure your Python interpreter doesn't try to load these packages locally.

## Avoiding Import Errors

There are two ways to avoid import errors when using packages that aren't installed locally.

### Import Packages Inline

Importing packages inline is safe because the functions will only be invoked in the remote Beam environment that has these packages installed.

```python theme={null}
from beam import endpoint, Image


@endpoint(image=Image(python_packages=["torch", "pandas", "numpy"]))
def handler():
    import torch
    import pandas
    import numpy
```

### Use `env.is_remote()`

An alternative to using inline imports is to use a special check called `env.is_remote()` to conditionally import packages *only* when inside the remote environment.

```python theme={null}
from beam import env


if env.is_remote():
    import torch
    import pandas
    import numpy
```

This command checks whether the Python script is running remotely on Beam, and will only try to import the packages in its scope if it is.

<Warning>
  While it might be tempting to use the `env.is_remote()` flag for other logic
  in your app, this command should only be used for package imports.
</Warning>

## Bug Fixes

* Encrypted secret values no longer returned in `/task` status API
* Fix nested list serialization in `**inputs`
