Log timestamp of a request
This commit is contained in:
parent
48bb561c17
commit
e657640409
@ -145,7 +145,8 @@ static std::string method_to_string(webcxx::RequestType method) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void webcxx::Request::log(int status_code) {
|
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(¤t_time), m_ip.c_str(),
|
||||||
method_to_string(m_method).c_str(),
|
method_to_string(m_method).c_str(),
|
||||||
m_real_path.c_str(),
|
m_real_path.c_str(),
|
||||||
status_code);
|
status_code);
|
||||||
|
Loading…
Reference in New Issue
Block a user