From 5ca693495aecad417a1ad449709280073235b7c6 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 9 May 2026 20:33:36 +0100 Subject: [PATCH] vmm: api: Log HTTP API error responses Although a response is sent to the client these errors are not logged in the log file making it hard to cross reference these with other log entries. Signed-off-by: Rob Bradford --- vmm/src/api/http/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmm/src/api/http/mod.rs b/vmm/src/api/http/mod.rs index 3461c08af..f7cea4faf 100644 --- a/vmm/src/api/http/mod.rs +++ b/vmm/src/api/http/mod.rs @@ -15,7 +15,7 @@ use std::sync::mpsc::Sender; use std::thread; use hypervisor::HypervisorType; -use log::error; +use log::{error, info}; use micro_http::{ Body, HttpServer, MediaType, Method, Request, Response, ServerError, StatusCode, Version, }; @@ -90,6 +90,8 @@ pub fn error_response(error: HttpError, status: StatusCode) -> Response { .map(|error| format!("{error}")) .collect::>(); + info!("HTTP API error response: {}", error_messages.join(": ")); + // TODO: Move `api` module from `vmm` to dedicated crate and use a common type definition let json = serde_json::to_string(&error_messages).unwrap();