server : skip GH copilot requests from logging

This commit is contained in:
Georgi Gerganov 2024-02-24 15:02:25 +02:00
parent 04b5a92478
commit 65e65fd6c0
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -2605,19 +2605,27 @@ static json format_detokenized_response(std::string content)
static void log_server_request(const httplib::Request &req, const httplib::Response &res) static void log_server_request(const httplib::Request &req, const httplib::Response &res)
{ {
LOG_INFO("request", { // skip GH copilot requests when using default port
{"remote_addr", req.remote_addr}, if (req.path == "/v1/health" || req.path == "/v1/completions")
{"remote_port", req.remote_port}, {
{"status", res.status}, return;
{"method", req.method}, }
{"path", req.path},
{"params", req.params},
});
LOG_VERBOSE("request", { LOG_INFO("request",
{"request", req.body}, {
{"response", res.body}, {"remote_addr", req.remote_addr},
}); {"remote_port", req.remote_port},
{"status", res.status},
{"method", req.method},
{"path", req.path},
{"params", req.params},
});
LOG_VERBOSE("request",
{
{"request", req.body},
{"response", res.body},
});
} }
struct token_translator struct token_translator