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

# Logger Plugin

> Add structured lifecycle logs with the built-in logger plugin.

Use `logger(...)` when you want request-aware logs around tool execution without wiring your own hooks every time.

## Basic example

```ts theme={null}
import { logger, Redop } from "@redopjs/redop";

new Redop({ serverInfo: { name: "logs" } }).use(logger({ level: "info" }));
```

## Send logs somewhere else

```ts theme={null}
new Redop({ serverInfo: { name: "logs" } }).use(
  logger({
    write: (entry) => {
      console.log("[my-app]", JSON.stringify(entry));
    },
  }),
);
```

## Good use cases

* local debugging
* structured request logs
* pairing with log drains or observability tooling
* lightweight visibility before building custom hooks

## See also

* [Built-in plugins reference](/docs/reference/built-in-plugins)
* [Build a plugin or middleware](/docs/guides/build-plugin-or-middleware)
