> For the complete documentation index, see [llms.txt](https://webauthn-doc.spomky-labs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://webauthn-doc.spomky-labs.com/v3.3/deep-into-the-framework/debugging.md).

# Debugging

If you have troubles during the development of your application or if you want to keep track of every critical/error messages in production, you can use a [PSR-3 compatible logger](https://www.php-fig.org/psr/psr-3/).

## The Easy Way

```php
<?php

use App\Service\MyPsr3Logger;
use Webauthn\Server;

$server = new Server(
    $rpEntity,
    $publicKeyCredentialSourceRepository
);

// Set your logging service here
$server->setLogger(new MyPsr3Logger());
```

## The Hard Way

Prior to version 3.3, the following classes have an optional constructor parameter `$logger` that can accept the logging service. From version 3.3 onwards you should use their `setLogger` function instead.

* `Webauthn\AttestationStatement\AttestationObjectLoader`
* `Webauthn\AuthenticatorAssertionResponseValidator`
* `Webauthn\AuthenticatorAttestationResponseValidator`
* `Webauthn\PublicKeyCredentialLoader`
* `Webauthn\Counter\ThrowExceptionIfInvalid`

## The Symfony Way

{% code title="config/packages/webauthn.yaml" %}

```yaml
webauthn:
    logger: App\Service\MyPsr3Logger
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://webauthn-doc.spomky-labs.com/v3.3/deep-into-the-framework/debugging.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
