---
title: "ExecutionContext.logger"
description: "Structured logger for logs emitted by the currently executing task."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# ExecutionContext.logger

```python
ExecutionContext.logger: StructuredLogger
```

Structured logger for logs emitted by the currently executing task.

## Methods

```python
context.logger.debug(message, /, *args, **attributes) -> None
context.logger.info(message, /, *args, **attributes) -> None
context.logger.warning(message, /, *args, **attributes) -> None
context.logger.error(message, /, *args, **attributes) -> None
context.logger.exception(message, /, *args, **attributes) -> None
context.logger.critical(message, /, *args, **attributes) -> None
context.logger.bind(**attributes) -> StructuredLogger
```

Structured attributes are attached to the log record and become searchable telemetry attributes.

Direct Python runners also print logs to the console automatically, with colored levels, timezone-qualified timestamps, and structured attributes as `key=JSON` pairs. Bound attributes appear in console output too. Top-level `task_id`, `trace_id`, and `span_id` attributes are hidden from console output but preserved for exporters and CLI streaming.

See [Configure local console logging](/docs/workflows/run-and-inspect/logging#configure-local-console-logging) to change log levels or output streams, or use [`disable_console_logging()`](/docs/api-reference/python/tilebox.workflows/observability.logging.disable_console_logging) to turn off Tilebox-managed console output without disabling exports.

<h2 id="request-example">Usage example</h2>

```python
from tilebox.workflows import (
    ExecutionContext,
    Task,
)


class DownloadInput(Task):
    input_id: str

    def execute(
        self, context: ExecutionContext
    ) -> None:
        context.logger.info(
            "Started", input_id=self.input_id
        )

        log = context.logger.bind(
            component="download"
        )
        log.debug("Fetching input")
```

Source: https://tilebox.com/docs/api-reference/python/tilebox.workflows/ExecutionContext.logger/index.mdx
