Skip to main content
The PHP SDK reports what it is doing through the PSR-3 LoggerInterface. Pass any PSR-3 implementation as NexusConfig::$logger - Monolog, Laravel’s Log facade, Symfony’s autowired LoggerInterface. With $logger left null (the default), the SDK is silent.

Configuration

What the SDK logs

Structured, not interpolated

Messages are stable strings; values go in the PSR-3 $context array:
That is what lets a log aggregator group every sync together and query the counts. A message with its values interpolated into the text is a unique string per occurrence and cannot be grouped or queried at all.

Secrets never appear in log output

Nothing derived from a secret is logged - not the value, and not the key name, which is itself part of what a secret store protects. Sync activity is reported as counts. API keys, session tokens and OIDC tokens never appear either. This is enforced, not merely intended: a permanent test drives a sync carrying both a text-type and a file-type secret through a capturing logger at the most verbose level, and fails if either value or either key name appears anywhere in the output.

A failing logger is contained

A logger that itself throws - a Monolog handler on a full disk, a down syslog target - cannot take an SDK call down with it. Diagnostic writes are contained, so a logging fault degrades logging alone rather than failing the config, secret or WIF operation it was reporting on.

Monolog example

Monolog is the most common PSR-3 implementation in PHP:
To route SDK logs to a dedicated channel:

Symfony Dependency Injection

In a Symfony application, inject the LoggerInterface via DI:
Or in a factory service:

Laravel

Nothing to do: the service provider takes the logger from the container, so SDK output reaches your application log automatically. Set NEXUS_LOG_CHANNEL to keep it on its own channel:
Add that channel to config/logging.php:

Silencing SDK logs

If you want the SDK to produce no output at all, pass a NullLogger:
NullLogger ships with psr/log, which the SDK already requires, so there is no extra dependency. Alternatively, leave $logger as null (the default) - the SDK omits all logging in that case.