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.

The Easy Way

1
<?php
2
3
use App\Service\MyPsr3Logger;
4
use Webauthn\Server;
5
6
$server = new Server(
7
$rpEntity,
8
$publicKeyCredentialSourceRepository
9
);
10
11
// Set your logging service here
12
$server->setLogger(new MyPsr3Logger());
Copied!

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

config/packages/webauthn.yaml
1
webauthn:
2
logger: App\Service\MyPsr3Logger
Copied!
Last modified 1d ago
Export as PDF
Copy link