> For the complete documentation index, see [llms.txt](https://alexisvisco.gitbook.io/kcd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alexisvisco.gitbook.io/kcd/hooks-and-extractors/log-hook.md).

# Log hook

The log hook is the hook called when a critical error occur (for example a 500 status code, or a problem with KCD for decoding a value)

A log hook must have this signature:

```go
type LogHook func(w http.ResponseWriter, r *http.Request, err error)
```

{% hint style="info" %}
Check out the default [log hook implementation here](https://github.com/expectedsh/kcd/blob/master/pkg/hook/log.go).

Check out the signature of the [log hook](https://github.com/expectedsh/kcd/blob/master/pkg/hook/hooks.go#L31).
{% endhint %}
