]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: action: add do-log action
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 20 Sep 2024 07:34:13 +0000 (09:34 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 4 Oct 2024 19:38:14 +0000 (21:38 +0200)
commit3ba924a4da0e5cfdca695b3f3dd5a0ff9f32e736
tree0f85fcc5fb6d9ecc93b994e0a4268b1236daf344
parent0e271f1d2a29089a566f1f30323d92cda6988506
MINOR: action: add do-log action

Thanks to the two previous commits, we can now expose the do-log action
on all available action contexts, including the new quic-init context.

Each context is responsible for exposing the do-log action by registering
the relevant log steps, saving the idendifier, and then store it in the
rule's context so that do_log_action() automatically uses it to produce
the log during runtime.

To use the feature, it is simply needed to use "do-log" (without argument)
on an action directive, example:

   tcp-request connection do-log

As mentioned before, each context where the action is exposed has its own
log step identifier. Currently known identifiers are:

  quic-initial:           quic-init
  tcp-request connection: tcp-req-conn
  tcp-request session:    tcp-req-sess
  tcp-request content:    tcp-req-cont
  tcp-response content:   tcp-res-cont
  http-request:           http-req
  http-response:          http-res
  http-after-response:    http-after-res

Thus, these "additional" logging steps can be used as-is under log-profile
section (after "on" keyword). However, although the parser will accept
them, it makes no sense to use them with the "log-steps" proxy keyword,
since the only path for these origins to trigger a log generation is
through the explicit use of "do-log" action.

This need was described in GH #401, it should help to conditionally
trigger logs using ACL at specific key points.. and may either be used
alone or combined with "log-steps" to add additional log "trackers" during
transaction handling.

Documentation was updated and some examples were added.
doc/configuration.txt
src/http_act.c
src/quic_rules.c
src/tcp_act.c