Module formatters

Source
Expand description

Components with which common log formats can be constructed

Functions§

apache_combined
apache combined log format
apache_common
apache common log format
body_len_human
formatter for the response body length, represented as a human-readable string like 5 bytes or 10.1mb. prints - if there is no response body. see bytes for the raw number of bytes
bytes
formatter that prints the number of response body bytes as a number. see body_len_human for a human-readable response body length with units
dev_formatter
simple development-mode formatter
headerDeprecated
please use request_header instead. it was a mistake to name this header as it is not apparent whether it’s inbound or outbound.
ip
formatter for the peer ip address of the connection
method
formatter for the conn’s http method that delegates to [Method]’s Display implementation
request_header
formatter-builder for a particular request header, formatted wrapped in quotes. "" if the header is not present
response_header
formatter-builder for a particular response header, formatted wrapped in quotes. "" if the header is not present
response_time
formatter for the wall-time duration with units that this http request-response cycle took, from the first bytes read to the completion of the response.
secure
formatter that prints an emoji if the request is secure as determined by [Conn::is_secure]
status
formatter for the http status
timestamp
formatter for the current timestamp. this represents the time that the log is written, not the beginning timestamp of the request
url
formatter for the current url or path of the request, including query
version
formatter for the http version, as delegated to the display implementation of [Version]