docs: Clean up proxy logging docs

Change-Id: I6ef909e826d3901f24d3c42a78d2ab1e4e47bb64
This commit is contained in:
Tim Burke 2023-08-04 11:30:42 -07:00
parent 95a2c71f23
commit 0c9b545ea7
3 changed files with 18 additions and 10 deletions

View File

@ -37,7 +37,7 @@ The default log format is::
Some keywords, signaled by the (anonymizable) flag, can be anonymized by
using the transformer 'anonymized'. The data are applied the hashing method of
`log_anonymization_method` and an optional salt `log_anonymization_salt`.
``log_anonymization_method`` and an optional salt ``log_anonymization_salt``.
Some keywords, signaled by the (timestamp) flag, can be converted to standard
dates formats using the matching transformers: 'datetime', 'asctime' or
@ -46,9 +46,11 @@ seconds, milliseconds, microseconds and nanoseconds. Python's strftime
directives can also be used as tranformers (a, A, b, B, c, d, H, I, j, m, M, p,
S, U, w, W, x, X, y, Y, Z).
Example {client_ip.anonymized} {remote_addr.anonymized} {start_time.iso8601}
{end_time.H}:{end_time.M} {method} acc:{account} cnt:{container}
obj:{object.anonymized}
Example::
{client_ip.anonymized} {remote_addr.anonymized} {start_time.iso8601}
{end_time.H}:{end_time.M} {method} acc:{account} cnt:{container}
obj:{object.anonymized}
=================== ==========================================================
**Log Field** **Value**

View File

@ -1028,7 +1028,8 @@ use = egg:swift#proxy_logging
# log_anonymization_salt =
#
# Template used to format access logs. All words surrounded by curly brackets
# will be substituted with the appropriate values
# will be substituted with the appropriate values. For more information, see
# https://docs.openstack.org/swift/latest/logs.html
# log_msg_template = {client_ip} {remote_addr} {end_time.datetime} {method} {path} {protocol} {status_int} {referer} {user_agent} {auth_token} {bytes_recvd} {bytes_sent} {client_etag} {transaction_id} {headers} {request_time} {source} {log_info} {start_time} {end_time} {policy_index}
# Note: Put before both ratelimit and auth in the pipeline.

View File

@ -19,12 +19,12 @@ Logging middleware for the Swift proxy.
This serves as both the default logging implementation and an example of how
to plug in your own logging format/method.
The logging format implemented below is as follows:
The logging format implemented below is as follows::
client_ip remote_addr end_time.datetime method path protocol
status_int referer user_agent auth_token bytes_recvd bytes_sent
client_etag transaction_id headers request_time source log_info
start_time end_time policy_index
client_ip remote_addr end_time.datetime method path protocol
status_int referer user_agent auth_token bytes_recvd bytes_sent
client_etag transaction_id headers request_time source log_info
start_time end_time policy_index
These values are space-separated, and each is url-encoded, so that they can
be separated with a simple .split()
@ -49,6 +49,11 @@ be separated with a simple .split()
* Values that are missing (e.g. due to a header not being present) or zero
are generally represented by a single hyphen ('-').
.. note::
The message format may be configured using the ``log_msg_template`` option,
allowing fields to be added, removed, re-ordered, and even anonymized. For
more information, see https://docs.openstack.org/swift/latest/logs.html
The proxy-logging can be used twice in the proxy server's pipeline when there
is middleware installed that can return custom responses that don't follow the
standard pipeline to the proxy server.