]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: spoe: use agent's logger to log SPOE messages
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 26 Mar 2018 15:20:58 +0000 (17:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Apr 2018 13:13:54 +0000 (15:13 +0200)
Instead of using the logger of the stream, we now use dedicated logger of the
SPOE. This means a logger should be defined.

doc/SPOE.txt
src/flt_spoe.c

index 9583d6941a0d05fc02d012143b968c8e5e8ee10b..016590e3f6f5d8296ec3d4a1d1d20c0e286100ff 100644 (file)
@@ -1197,7 +1197,8 @@ SPOE. Depending on the status code, the log level will be different. In the
 normal case, when no error occurred, the message is logged with the level
 LOG_NOTICE. Otherwise, the message is logged with the level LOG_WARNING.
 
-The messages are logged using the stream's logger and use the following format:
+The messages are logged using the agent's logger, if defined, and use the
+following format:
 
     SPOE: [AGENT] <TYPE:NAME> sid=STREAM-ID st=STATUC-CODE reqT/qT/wT/resT/pT
 
index abd96cc912820fce854255de4e5c7e63c631c4c6..3b425cc3cf44bb6347f9a34a206c9b1c11e715fe 100644 (file)
@@ -2052,7 +2052,7 @@ spoe_queue_context(struct spoe_context *ctx)
                            " - failed to create SPOE appctx\n",
                            (int)now.tv_sec, (int)now.tv_usec, agent->id,
                            __FUNCTION__, ctx->strm);
-               send_log(ctx->strm->be, LOG_EMERG,
+               send_log(&conf->agent_fe, LOG_EMERG,
                         "SPOE: [%s] failed to create SPOE applet\n",
                         agent->id);
 
@@ -2717,7 +2717,7 @@ spoe_process_group(struct stream *s, struct spoe_context *ctx,
                            __FUNCTION__, s, s->uniq_id, ctx->status_code,
                            ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting,
                            ctx->stats.t_response, ctx->stats.t_process);
-               send_log(s->be, (!ctx->status_code ? LOG_NOTICE : LOG_WARNING),
+               send_log(&conf->agent_fe, (!ctx->status_code ? LOG_NOTICE : LOG_WARNING),
                         "SPOE: [%s] <GROUP:%s> sid=%u st=%u %ld/%ld/%ld/%ld/%ld\n",
                         agent->id, group->id, s->uniq_id, ctx->status_code,
                         ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting,
@@ -2755,7 +2755,7 @@ spoe_process_event(struct stream *s, struct spoe_context *ctx,
                            __FUNCTION__, s, spoe_event_str[ev], s->uniq_id, ctx->status_code,
                            ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting,
                            ctx->stats.t_response, ctx->stats.t_process);
-               send_log(s->be, (!ctx->status_code ? LOG_NOTICE : LOG_WARNING),
+               send_log(&conf->agent_fe, (!ctx->status_code ? LOG_NOTICE : LOG_WARNING),
                         "SPOE: [%s] <EVENT:%s> sid=%u st=%u %ld/%ld/%ld/%ld/%ld\n",
                         agent->id, spoe_event_str[ev], s->uniq_id, ctx->status_code,
                         ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting,
@@ -3047,7 +3047,7 @@ spoe_start(struct stream *s, struct filter *filter)
                            " - failed to create SPOE context\n",
                            (int)now.tv_sec, (int)now.tv_usec, agent->id,
                            __FUNCTION__, s);
-               send_log(s->be, LOG_EMERG,
+               send_log(&conf->agent_fe, LOG_EMERG,
                         "SPOE: [%s] failed to create SPOE context\n",
                         agent->id);
                return 0;