From ff9c276c144bc24c70f1d5b531a8fd412c34c3d9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 13 Oct 2023 12:17:45 +0000 Subject: Improved logging system Signed-off-by: Laurent Bercot --- doc/tipidee.conf.html | 38 ++++++++++++++++++++++++-------------- doc/tipideed.html | 12 +++++------- 2 files changed, 29 insertions(+), 21 deletions(-) (limited to 'doc') diff --git a/doc/tipidee.conf.html b/doc/tipidee.conf.html index 99b9e8c..76ffae1 100644 --- a/doc/tipidee.conf.html +++ b/doc/tipidee.conf.html @@ -348,14 +348,20 @@ In normal operation, if everything goes well, you should never see any of these.
  • Depending on what the log directive says, it also prints informational messages related to what it's doing. These informational -messages all have the prefix "tipideed: pid pid: info: ".
  • +messages all have the prefix "tipideed: pid pid: info: ". +
  • If no log directive has been provided, the default is -log request answer size.
  • +log request answer answer_size.

    - Here are the informational log lines printed by tipideed, -depending on the keywords in the log directive: + Here is the full list of keywords and what they do:

    @@ -375,17 +381,17 @@ TCPREMOTEIP otherwise. Make sure to invoke tipideed in order to get meaningful values for this field. This keyword has no effect when given without the start keyword.
    host_as_prefix
    Prepend all request, resource and answer -lines with a host host field. This field will not be repeated in the request -line, so it changes the order of the fields. host is the virtual host the request is addressed +lines with a host host field. (This field will not be repeated in the request +line, so it changes the order of the fields in that line.) host is the virtual host the request is addressed to. host_as_prefix is useful when you want to log entries for different virtual hosts to -different locations. For instance, if you're using +different locations: for instance, if you're using s6-log, and want entries for example.com and example.org to be logged to different backends, you would use the host_as_prefix directive, -and use - +"^tipidee: pid [[:digit:]]*: info: host example\\.com " to select example.com-related -lines, and - +"^tipidee: pid [[:digit:]]*: info: host example\\.org " +and use - +"^tipidee: pid [[:digit:]]*: info: host example\\.com " in your logging script +to select example.com-related lines, and +- +"^tipidee: pid [[:digit:]]*: info: host example\\.org " to select example.org-related lines. Note that warning and error messages would still need an additional -backend, as well as start and exit lines if you add the start directive -to your log configuration.
    +backend, as well as potential start and exit lines.
    request
    Log a request line when tipideed receives a request from its client. The line looks like request method host host path "path" http version. The path is decoded, but if there are non-printable characters in it, they are @@ -403,11 +409,15 @@ This keyword has no effect when given without the request keyword.
    resource docroot docroot file file type type. docroot is the document root of the virtual host; file is the path to the served file; type -is nph for an NPH script, cgi for a CGI script, or the Content-Type for a regular file. +is nph for an NPH script, cgi for a CGI script, or the Content-Type for a regular file. +If a served CGI script outputs a local redirection, several resource lines may appear for +a single request.
    answer
    Log an answer line when tipideed answers the currently processed request. The line looks like answer status, where status is -the 3-digit status code returned to the client.
    -
    size
    Add a size size field to the answer line, +the 3-digit status code returned to the client. Note that there will be no answer line +when a NPH script is being run (because tipideed execs into the +NPH script).
    +
    answer_size
    Add a size size field to the answer line, containing the Content-Length of the answer. This keyword has no effect when given without the answer keyword.
    debug
    Log debug information. You should not need this in regular use.
    diff --git a/doc/tipideed.html b/doc/tipideed.html index 977317c..1d764ff 100644 --- a/doc/tipideed.html +++ b/doc/tipideed.html @@ -91,15 +91,14 @@ of the tipidee package provides service templates to help you run tipideed under
    0
    Clean exit. There was a successful stream of HTTP exchanges, -that the client decided to end — including by being inactive long enough -that tipideed closes the connection on its own initiative, which is permitted -by HTTP.
    +that either tipideed or the client decided to end in a way that is +permitted by HTTP.
    1
    Illicit client behaviour. tipideed exited because it could not serve the client in good faith.
    2
    Illicit CGI script behaviour. tipideed exited because the invoked CGI script made it impossible to continue. Before exiting, tipideed likely has sent a 502 (Bad Gateway) response to the client.
    -
    100
    Bad usage. tipideed has been run in an incorrect way: bad command +
    100
    Bad usage. tipideed was run in an incorrect way: bad command line options, or missing environment variables, etc.
    101
    Cannot happen. This signals a bug in tipideed, and comes with an error message asking you to report the bug. Please do so, on the @@ -108,9 +107,8 @@ error message asking you to report the bug. Please do so, on the data or in the document layout that it does not like. This can happen, for instance, when a document is a symbolic link pointing outside of the server's root.
    -
    111
    System call failed. If this happens while serving a request, -tipideed likely has sent a 500 (Internal Server Error) response to the -client before exiting.
    +
    111
    System call failed. This usually signals a problem with the +underlying system.
    -- cgit v1.3.1