struct process_send_log_ctx {
struct session *sess;
struct stream *stream;
+ struct log_profile *profile;
struct log_orig origin;
};
enum log_orig_id orig = (ctx) ? ctx->origin.id : LOG_ORIG_UNSPEC;
uint16_t orig_fl = (ctx) ? ctx->origin.flags : LOG_ORIG_FL_NONE;
+ /* ctx->profile gets priority over logger profile */
+ if (ctx && ctx->profile)
+ prof = ctx->profile;
+
BUG_ON(!prof);
if (!b_is_null(&prof->log_tag))
nblogger += 1;
- /* logger may use a profile to override a few things */
- if (unlikely(logger->prof))
+ /* caller or default logger may use a profile to override a few things */
+ if (unlikely(logger->prof || (ctx && ctx->profile)))
_process_send_log_override(ctx, logger, hdr, message, size, nblogger);
else
_process_send_log_final(logger, hdr, message, size, nblogger);
ctx.origin = origin;
ctx.sess = sess;
ctx.stream = s;
+ ctx.profile = NULL;
do_log_ctx(&ctx);
}
ctx.origin = origin;
ctx.sess = sess;
ctx.stream = s;
+ ctx.profile = NULL;
__send_log(&ctx, &sess->fe->loggers, &sess->fe->log_tag, level,
logline, size, logline_rfc5424, sd_size);
s->logs.logwait = 0;
ctx.origin = orig;
ctx.sess = sess;
ctx.stream = NULL;
+ ctx.profile = NULL;
__send_log(&ctx, &sess->fe->loggers,
&sess->fe->log_tag, level,
logline, size, logline_rfc5424, sd_size);