MINOR: spoe: use agent's logger to log SPOE messages

Instead of using the logger of the stream, we now use dedicated logger of the
SPOE. This means a logger should be defined.
This commit is contained in:
Christopher Faulet 2018-03-26 17:20:58 +02:00 committed by Willy Tarreau
parent 0e0f085a73
commit 3b8e34902b
2 changed files with 6 additions and 5 deletions

View 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 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. 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 SPOE: [AGENT] <TYPE:NAME> sid=STREAM-ID st=STATUC-CODE reqT/qT/wT/resT/pT

View File

@ -2052,7 +2052,7 @@ spoe_queue_context(struct spoe_context *ctx)
" - failed to create SPOE appctx\n", " - failed to create SPOE appctx\n",
(int)now.tv_sec, (int)now.tv_usec, agent->id, (int)now.tv_sec, (int)now.tv_usec, agent->id,
__FUNCTION__, ctx->strm); __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", "SPOE: [%s] failed to create SPOE applet\n",
agent->id); agent->id);
@ -2717,7 +2717,7 @@ spoe_process_group(struct stream *s, struct spoe_context *ctx,
__FUNCTION__, s, s->uniq_id, ctx->status_code, __FUNCTION__, s, s->uniq_id, ctx->status_code,
ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting, ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting,
ctx->stats.t_response, ctx->stats.t_process); 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", "SPOE: [%s] <GROUP:%s> sid=%u st=%u %ld/%ld/%ld/%ld/%ld\n",
agent->id, group->id, s->uniq_id, ctx->status_code, agent->id, group->id, s->uniq_id, ctx->status_code,
ctx->stats.t_request, ctx->stats.t_queue, ctx->stats.t_waiting, 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, __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_request, ctx->stats.t_queue, ctx->stats.t_waiting,
ctx->stats.t_response, ctx->stats.t_process); 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", "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, agent->id, 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_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", " - failed to create SPOE context\n",
(int)now.tv_sec, (int)now.tv_usec, agent->id, (int)now.tv_sec, (int)now.tv_usec, agent->id,
__FUNCTION__, s); __FUNCTION__, s);
send_log(s->be, LOG_EMERG, send_log(&conf->agent_fe, LOG_EMERG,
"SPOE: [%s] failed to create SPOE context\n", "SPOE: [%s] failed to create SPOE context\n",
agent->id); agent->id);
return 0; return 0;