---
title: LogEndpoint
summary: Interface to a Fastly logging endpoint.
url: https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/log/class.LogEndpoint/
---

**Kind:** Class  
**Module:** [log](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/log/)  
**Package:** fastly-compute 0.1.3  
**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/log.py#L34

Extends `FastlyResource[wit_log.Endpoint]`.

Interface to a Fastly logging endpoint.

Logging endpoints send log data to configured Real-Time Log Streaming
destinations. Configure endpoints through the Fastly web interface or API.

```python
with LogEndpoint.open("my_logs") as endpoint:
    endpoint.write("Application started")
    endpoint.write(b"Binary log data")
```

## Methods

### open

**Flags:** static  
**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/log.py#L48

```python
open(name: str) -> Self
```

Open a logging endpoint by name.

Names are case sensitive. Calling open() with a name that doesn't
correspond to any logging endpoint available in your service will
still return a usable endpoint, and writes to that endpoint will
succeed. Refer to your service dashboard to diagnose missing log events.

Currently, the conditions on an endpoint name are:
- It must not be empty.
- It must not contain newlines (\n) or colons (:).
- It must not be `stdout` or `stderr`, which are reserved for debugging.

**Parameters**

- `name`: `str` — The name of the logging endpoint

**Returns**

`Self`

LogEndpoint instance

**Throws**

- [NotFound](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.NotFound/) — If the endpoint doesn't exist or can't be created.
- [NameTooLong](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.NameTooLong/) — If the name is too long.
- [InvalidSyntax](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.InvalidSyntax/) — If the name is invalid.

```python
endpoint = LogEndpoint.open("my_logs")
```

### write

**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/log.py#L74

```python
write(msg: bytes | str) -> None
```

Write data to the logging endpoint.

Each call to write() with a non-empty message produces a single log event.

**Parameters**

- `msg`: `bytes | str` — The message to write (bytes or string). Strings are UTF-8 encoded.

**Returns**

`None`

```python
endpoint = LogEndpoint.open("my_logs")
endpoint.write("Text message")
endpoint.write(b"Binary data")
```
