From 644638c2bd0969d89332957ab1ab57aa088f1062 Mon Sep 17 00:00:00 2001 From: ernolf Date: Fri, 17 Jul 2026 18:05:29 +0200 Subject: [PATCH] feat: unify config keys under the audit_http_client_ prefix - logdir_audit_http_client -> audit_http_client_logdir, loglevel_audit_http_client -> audit_http_client_loglevel, audit_http_client_logs -> audit_http_client_format, audit_http_client_logs_exclude_domain -> audit_http_client_exclude_domains - breaking: the old key names are no longer read, there is no fallback Signed-off-by: ernolf --- README.md | 16 ++++++++-------- lib/Http/Client/LoggingClientService.php | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4d2b00d..7757c51 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ Nextcloud app that logs all outgoing HTTP requests made by Nextcloud's built-in All settings are optional. -### `logdir_audit_http_client` +### `audit_http_client_logdir` Explicit override for the log directory. Takes precedence over everything else. ```php -'logdir_audit_http_client' => '/var/log/nextcloud/http_client', +'audit_http_client_logdir' => '/var/log/nextcloud/http_client', ``` If this key is absent, the log directory is derived automatically: @@ -36,7 +36,7 @@ If this key is absent, the log directory is derived automatically: The directory is created automatically on first use. -### `loglevel_audit_http_client` +### `audit_http_client_loglevel` Controls which responses are logged. Default: `0`. @@ -49,10 +49,10 @@ Controls which responses are logged. Default: `0`. Network errors (connection failures, DNS failures, etc.) are always logged regardless of this setting. ```php -'loglevel_audit_http_client' => 1, +'audit_http_client_loglevel' => 1, ``` -### `audit_http_client_logs` +### `audit_http_client_format` Selects the log output format. Default: `'both'`. @@ -69,15 +69,15 @@ a3f9bc 2026-05-05T14:23:01+00:00 GET https://example.com/feed HTTP/2 200 compres ``` ```php -'audit_http_client_logs' => 'json', +'audit_http_client_format' => 'json', ``` -### `audit_http_client_logs_exclude_domain` +### `audit_http_client_exclude_domains` List of hostnames to exclude from logging. Requests to matching hosts are passed through without any log entry. Matching is case-insensitive. Wildcard prefix (`*.example.com`) is supported and also matches the bare domain (`example.com`). Default: `[]`. ```php -'audit_http_client_logs_exclude_domain' => [ +'audit_http_client_exclude_domains' => [ 'apps.nextcloud.com', 'updates.nextcloud.com', '*.googleapis.com', diff --git a/lib/Http/Client/LoggingClientService.php b/lib/Http/Client/LoggingClientService.php index f3bd291..90b3bd0 100644 --- a/lib/Http/Client/LoggingClientService.php +++ b/lib/Http/Client/LoggingClientService.php @@ -46,9 +46,9 @@ public function newClient(?callable $handler = null): IClient { new HttpClientLoggerMiddleware( $this->logger, $this->resolveLogDir(), - (int)$this->config->getSystemValue('loglevel_audit_http_client', 0), - $this->config->getSystemValueString('audit_http_client_logs', 'both'), - (array)$this->config->getSystemValue('audit_http_client_logs_exclude_domain', []), + (int)$this->config->getSystemValue('audit_http_client_loglevel', 0), + $this->config->getSystemValueString('audit_http_client_format', 'both'), + (array)$this->config->getSystemValue('audit_http_client_exclude_domains', []), (array)$this->config->getSystemValue('audit_http_client_redact_headers', []), $this->request->getId(), ), @@ -65,7 +65,7 @@ public function newClient(?callable $handler = null): IClient { } private function resolveLogDir(): string { - $explicit = $this->config->getSystemValueString('logdir_audit_http_client', ''); + $explicit = $this->config->getSystemValueString('audit_http_client_logdir', ''); if ($explicit !== '') { return rtrim($explicit, '/'); }