]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] session logging is now defined by the frontend
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Dec 2006 16:18:38 +0000 (17:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Dec 2006 16:18:38 +0000 (17:18 +0100)
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.

src/log.c
src/proto_http.c

index 19cfa99a7c94b8ab8a337f6537eebbb515a071e2..a29223b05e299c040ad282523ca9b0b82d768dbf 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -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 : "-",
index 83fb1da3231049084b2e14ef4f892d02c52c6ce2..5c26f044ae90361d9bf4da2c7a3cb3764977f433 100644 (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;