]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: config: document proxy "log-steps" keyword
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 5 Sep 2024 14:20:00 +0000 (16:20 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 26 Sep 2024 14:53:07 +0000 (16:53 +0200)
Now that "log-steps" proxy keyword is functional, let's add some
documentation and usage examples for it.

doc/configuration.txt

index 966bfbad027ff4d3615e7ab0b176ff5fd92f8d67..8799e945a470a4d2584c0bbfc2772c72a62f7b06 100644 (file)
@@ -5422,6 +5422,7 @@ log                                  (*)  X          X         X         X
 log-format                                X          X         X         -
 log-format-sd                             X          X         X         -
 log-tag                                   X          X         X         X
+log-steps                                 X          X         X         -
 max-keep-alive-queue                      X          -         X         X
 max-session-srv-conns                     X          X         X         -
 maxconn                                   X          X         X         -
@@ -8574,6 +8575,44 @@ log-format-sd <fmt>
   Example :
     log-format-sd [exampleSDID@1234\ bytes=\"%B\"\ status=\"%ST\"]
 
+log-steps <steps>
+  Specifies at which steps during transaction processing logs should be
+  generated.
+
+  May be used in the following contexts: tcp, http
+
+  May be used in sections:    defaults | frontend | listen | backend
+                                 yes   |    yes   |   yes  |   no
+
+  During tcp/http transaction processing, haproxy may produce logs at different
+  steps during the processing (ie: accept, connect, request, response, close).
+
+  By default, HAProxy emits a single log per transaction, once all of the
+  items used in the logformat expression could be satisfied, which means
+  that in practice the log is usually emitted at the end of the transaction
+  (after the end of the response for HTTP or end of connection for TCP),
+  unless "option logasap" is used.
+
+  The "log-steps" directive allows to refine the precise instants where
+  logs will be emitted, and even permits to emit multiple logs for a
+  same transaction. Special value 'all' may be used to enable all available
+  log origins, making it possible to track a transaction from accept to close.
+  Indidivual log origins may also be specified using their names separated by
+  spaces to selectively enable when logs should be produced.
+
+  Common log origins are: accept, connect, request, response, close.
+
+  Example:
+     frontend myfront
+         option httplog
+         log-steps accept,close         #only log accept and close for the txn
+
+  Log origins specified as "logging steps" (such as accept, close) can be
+  used as-is in log-profiles (after 'on' directive). Combining "log-steps"
+  with log-profiles is really interesting to have fine-grained control over
+  logs automatically generated by haproxy during transaction processing.
+
+  See also : "log-profile"
 
 log-tag <string>
   Specifies the log tag to use for all outgoing logs