---
title: log
summary: Logging API for Fastly Compute.
url: https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/log/
---

**Kind:** Module  
**Package:** fastly-compute 0.1.3  
**Path:** `fastly_compute::log`

Logging API for Fastly Compute.

This module provides access to Fastly logging endpoints, allowing you to send
logs to configured Real-Time Log Streaming endpoints.

```python
from fastly_compute import LogEndpoint

# Direct usage
endpoint = LogEndpoint.open("my_logs")
endpoint.write("Hello from Fastly Compute!")

# Using Python standard logging
import logging
from fastly_compute import FastlyLogHandler

logger = logging.getLogger("my_app")
logger.setLevel(logging.INFO)
logger.addHandler(FastlyLogHandler("my_logs"))

logger.info("Request processed", extra={"user_id": 123})
```

## Classes

| Name | Summary |
| --- | --- |
| [FastlyLogHandler](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/log/class.FastlyLogHandler/) | A logging handler that sends logs to a Fastly endpoint. |
| [LogEndpoint](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/log/class.LogEndpoint/) | Interface to a Fastly logging endpoint. |
