andrepayone/payone-sdk-silent-logger
PSR-3 silent/noop logger for the PAYONE Payment Integration PHP SDK. Use it when you need to satisfy logging dependencies without writing any logs—ideal for tests, minimal setups, or disabling SDK logging in production.
bind() or singleton()) and can be injected into the PAYONE SDK as a logger dependency.config/app.php or environment variables (e.g., LOG_PAYONE=false).psr/log:^1.1, which Laravel already includes.Monolog with a null handler) for critical paths.NullHandler (Monolog) suffice, or is this SDK-specific?Log facade and Monolog are PSR-3 compliant, so this logger integrates via the same interface.AppServiceProvider:
$this->app->bind(
Psr\Log\LoggerInterface::class,
function () {
return new \Andrepayone\PayoneSdkSilentLogger\SilentLogger();
}
);
config() to toggle:
$logger = config('app.debug') ? new MonologLogger() : new SilentLogger();
$payone = new \Payone\Sdk\Payone([
'logger' => new \Andrepayone\PayoneSdkSilentLogger\SilentLogger(),
]);
app()->bind() to test integration without modifying SDK code.composer.json allows overriding the logger dependency.debug mode:
class PayoneLogger implements LoggerInterface {
public function log($level, $message, array $context = []): void {
if (app()->environment('local')) {
Log::channel('payone')->log($level, $message, $context);
}
// Delegate to silent logger otherwise
}
}
APP_DEBUG=true in staging).PAYONE_LOG_LEVEL=debug) for emergencies.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| SDK throws unlogged exceptions | Silent failures in production | Enable exception monitoring (Sentry) |
| Logger swap breaks SDK | Payment processing halts | Test in staging with mock transactions |
| PHP 8.1+ incompatibility | Deployment fails | Use a polyfill or fork the package |
| PCI compliance audit | Logging gaps flagged | Document logger override in compliance |
AppServiceProvider.README section on "Disabling PAYONE Logging."config() to toggle globally.How can I help you explore Laravel packages today?