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

# LoggerEventBusMiddleware

> Log completed events to stdout and optional file.

`LoggerEventBusMiddleware` prints completed event summaries and can also write them to disk.

## Constructor params

* `log_path`: optional filesystem path for log output

## Setup with EventBus

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from abxbus import EventBus
    from abxbus.middlewares import LoggerEventBusMiddleware

    bus = EventBus(
        name='AppBus',
        middlewares=[LoggerEventBusMiddleware('./events.log')],
    )
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={null}
    // Not implemented in the Rust crate yet.
    // Use explicit typed handler wrappers around bus.on(...) for this behavior for now.
    ```
  </Tab>
</Tabs>

## Behavior

* Logs event summaries when events complete.
* Always prints to stdout.
* If `log_path` is provided, appends the same summary lines to the file.
* Creates parent directories for the log file automatically.
