From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 352941FF0AF for ; Fri, 23 Oct 2026 13:31:35 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D77782169F; Fri, 23 Oct 2026 13:31:27 +0200 (CEST) From: Thomas Ellmenreich To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager v2 6/7] api: remove manual setting of REST server debug flag Date: Fri, 23 Oct 2026 13:31:17 +0200 Message-ID: <20261023113120.332453-7-t.ellmenreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261023113120.332453-1-t.ellmenreich@proxmox.com> References: <20261023113120.332453-1-t.ellmenreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792755082676 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.392 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TXYIVC7ILD3B7STQHJNIT7E5SWAHAQNV X-Message-ID-Hash: TXYIVC7ILD3B7STQHJNIT7E5SWAHAQNV X-MailFrom: t.ellmenreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Thomas Ellmenreich X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Previously the REST server would be set to debug if the PROXMOX_DEBUG environment variable was set. Now the server itself checks the enabled log level and enables the debug flag accordingly. This means that users will now have to set the PROXMOX_DEBUG variable to debug for the REST server to enable its debug flag. Additionally, setting the debug log level for proxmox_rest_server::connection specifically will now also trigger the debug flag to be set, allowing for greater control. Signed-off-by: Thomas Ellmenreich --- server/src/bin/proxmox-datacenter-api/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/bin/proxmox-datacenter-api/main.rs b/server/src/bin/proxmox-datacenter-api/main.rs index eac1585b..1c107b1f 100644 --- a/server/src/bin/proxmox-datacenter-api/main.rs +++ b/server/src/bin/proxmox-datacenter-api/main.rs @@ -47,8 +47,6 @@ fn main() -> Result<(), Error> { server::env::sanitize_environment_vars(); - let debug = std::env::var("PROXMOX_DEBUG").is_ok(); - proxmox_log::Logger::from_env("PROXMOX_DEBUG", LevelFilter::INFO) .journald_on_no_workertask() .tasklog_pbs() @@ -70,7 +68,7 @@ fn main() -> Result<(), Error> { proxmox_product_config::init(pdm_config::api_user()?, pdm_config::priv_user()?); let app = server::context::init()?; - proxmox_async::runtime::main(run(app, debug)) + proxmox_async::runtime::main(run(app)) } async fn get_index_future(env: RestEnvironment, parts: Parts) -> Response { @@ -145,7 +143,7 @@ async fn get_index_future(env: RestEnvironment, parts: Parts) -> Response Result<(), Error> { +async fn run(app: PdmApplication) -> Result<(), Error> { auth::init(false); proxmox_acme_api::init(configdir!("/acme"), false)?; @@ -229,7 +227,7 @@ async fn run(app: PdmApplication, debug: bool) -> Result<(), Error> { } })?; - let connections = proxmox_rest_server::connection::AcceptBuilder::new().debug(debug); + let connections = proxmox_rest_server::connection::AcceptBuilder::new(); let server = proxmox_daemon::server::create_daemon( PDM_LISTEN_ADDR, move |listener| { -- 2.47.3