Log timestamp of a request

This commit is contained in:
apio 2022-11-04 20:21:57 +01:00
parent 48bb561c17
commit e657640409

View File

@ -145,7 +145,8 @@ static std::string method_to_string(webcxx::RequestType method) {
}
void webcxx::Request::log(int status_code) {
printf("%s - \"%s %s HTTP/1.1\" - %d\n", m_ip.c_str(),
time_t current_time = time(NULL);
printf("(%s) %s - \"%s %s HTTP/1.1\" - %d\n", ctime(&current_time), m_ip.c_str(),
method_to_string(m_method).c_str(),
m_real_path.c_str(),
status_code);