# Build Logging

<subtitle>Get template build logs in real-time and customize log processing logic.</subtitle>

>
> **Prerequisites**: Please complete [API Key Configuration](/docs/agent-sandbox/product/01-prerequisites) first

Build logs are pushed in real-time through the `on_build_logs` callback during the build process. You can use the default log processor or customize the processing logic.

>
> For build entry and status polling, see: [Build Templates](/docs/agent-sandbox/template/09-build)

## Default Log Processor

SDK provides the `default_build_logger` function, which can filter and output logs by level:

```python
from ucloud_sandbox import Template, default_build_logger

Template.build(
    template,
    alias="my-template",
    on_build_logs=default_build_logger(
        min_level="info",  # Minimum log level to display
    )
)
```

