[MEDIUM] session logging is now defined by the frontend

To solve the logging maze, it has been decided that the frontend
and nothing else will define how a session will be logged. It might
change in the future but at least this choice allows all sort of
fantasies.
This commit is contained in:
Willy Tarreau 2006-12-27 17:18:38 +01:00
parent 8058743d7a
commit 97de624c17
2 changed files with 17 additions and 5 deletions

View File

@ -302,7 +302,8 @@ void sess_log(struct session *s)
* computed.
*/
tolog = (fe->to_log | be->to_log | be->beprm->to_log); /* union of all logs */
/* FIXME: let's limit ourselves to frontend logging for now. */
tolog = (fe->to_log /*| be->to_log | be->beprm->to_log*/);
log = tolog & ~s->logs.logwait;
@ -325,8 +326,14 @@ void sess_log(struct session *s)
if (fe->logfac1 >= 0)
prx_log = fe;
else if (be->logfac1 >= 0)
prx_log = be;
/*
* FIXME: should we fall back to the backend if the frontend did not
* define any log ? It seems like we should not permit such complex
* setups because they would induce a debugging nightmare for the
* admin.
*/
// else if (be->logfac1 >= 0)
// prx_log = be;
else
prx_log = NULL; /* global */
@ -387,7 +394,7 @@ void sess_log(struct session *s)
(s->logs.t_queue >= 0) ? s->logs.t_queue - s->logs.t_request : -1,
(s->logs.t_connect >= 0) ? s->logs.t_connect - s->logs.t_queue : -1,
(s->logs.t_data >= 0) ? s->logs.t_data - s->logs.t_connect : -1,
(be->to_log & LW_BYTES) ? "" : "+", s->logs.t_close,
(tolog & LW_BYTES) ? "" : "+", s->logs.t_close,
s->logs.status,
(tolog & LW_BYTES) ? "" : "+", s->logs.bytes,
s->logs.cli_cookie ? s->logs.cli_cookie : "-",

View File

@ -3192,7 +3192,12 @@ void apply_filters_to_session(struct session *t, struct buffer *req, struct hdr_
t->be = target;
//t->logs.logwait |= LW_REQ | (target->to_log & (LW_REQHDR | LW_COOKIE));
t->logs.logwait |= (target->to_log | target->beprm->to_log);
/* FIXME: should we use the backend's log options or not ?
* It would seem far too complicated to configure a service with
* logs defined both in the frontend and the backend.
*/
//t->logs.logwait |= (target->to_log | target->beprm->to_log);
abort_filt = 1;
}
break;