]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server: do not log certain endpoints (avoid log spam) (#19028)
authorXuan-Son Nguyen <redacted>
Thu, 22 Jan 2026 18:24:37 +0000 (19:24 +0100)
committerGitHub <redacted>
Thu, 22 Jan 2026 18:24:37 +0000 (19:24 +0100)
tools/server/server-http.cpp

index 5d67e5722d1e0f0dd051058a62ae3a441552e59f..00897eeea5b675d70b892b9f06ccaaafdb2c13b0 100644 (file)
@@ -28,14 +28,20 @@ server_http_context::server_http_context()
 server_http_context::~server_http_context() = default;
 
 static void log_server_request(const httplib::Request & req, const httplib::Response & res) {
-    // skip GH copilot requests when using default port
-    if (req.path == "/v1/health") {
+    // skip logging requests that are regularly sent, to avoid log spam
+    if (req.path == "/health"
+        || req.path == "/v1/health"
+        || req.path == "/models"
+        || req.path == "/v1/models"
+        || req.path == "/props"
+        || req.path == "/metrics"
+    ) {
         return;
     }
 
     // reminder: this function is not covered by httplib's exception handler; if someone does more complicated stuff, think about wrapping it in try-catch
 
-    SRV_INF("request: %s %s %s %d\n", req.method.c_str(), req.path.c_str(), req.remote_addr.c_str(), res.status);
+    SRV_INF("done request: %s %s %s %d\n", req.method.c_str(), req.path.c_str(), req.remote_addr.c_str(), res.status);
 
     SRV_DBG("request:  %s\n", req.body.c_str());
     SRV_DBG("response: %s\n", res.body.c_str());