Commit 44526de0 authored by deuce's avatar deuce
Browse files

When logging and using virtual hosts, log every virtual host in it's own

separate file in the format:
(prefix)vhostname-date.log
parent 1ff67a5c
......@@ -155,6 +155,7 @@ struct log_data {
char *request;
char *referrer;
char *agent;
char *vhost;
int status;
unsigned int size;
struct tm completed;
......@@ -1753,6 +1754,8 @@ static BOOL get_req(http_session_t * session, char *request_line)
get_request_headers(session);
if(!get_fullpath(session))
return(FALSE);
if(session->req.ld!=NULL)
session->req.ld->vhost=strdup(session->req.vhost);
session->req.dynamic=is_dynamic_req(session);
if(session->req.query_str[0]) {
switch(session->req.dynamic) {
......@@ -2910,6 +2913,11 @@ void http_logging_thread(void* arg)
continue;
}
SAFECOPY(newfilename,base);
if(startup->options&WEB_OPT_VIRTUAL_HOSTS && ld->vhost!=NULL) {
strcat(newfilename,ld->vhost);
if(ld->vhost[0])
strcat(newfilename,"-");
}
strftime(strchr(newfilename,0),15,"%Y-%m-%d.log",&ld->completed);
if(strcmp(newfilename,filename)) {
if(logfile!=NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment