Plug.AccessLog v0.15.0 Plug.AccessLog.DefaultFormatter View Source
Default log message formatter.
Link to this section Summary
Functions
Formats a log message.
Link to this section Functions
Formats a log message.
The following formatting directives are available:
%%- Percentage sign%a- Remote IP-address%b- Size of response in bytes. Outputs "-" when no bytes are sent.%B- Size of response in bytes. Outputs "0" when no bytes are sent.%{VARNAME}C- Cookie sent by the client%D- Time taken to serve the request (microseconds)%{VARNAME}e- Environment variable contents%h- Remote hostname%{VARNAME}i- Header line sent by the client%l- Remote logname%m- Request method%M- Time taken to serve the request (milliseconds)%{VARNAME}o- Header line sent by the server%P- The process ID that serviced the request%q- Query string (prepended with "?" or empty string)%r- First line of HTTP request%>s- Response status code%t- Time the request was received in the format[10/Jan/2015:14:46:18 +0100]%T- Time taken to serve the request (full seconds)%{UNIT}T- Time taken to serve the request in the given UNIT%u- Remote user%U- URL path requested (without query string)%v- Server name%V- Server name (canonical)
Note for %b and %B: To determine the size of the response the
"Content-Length" will be inspected and, if available, returned
unverified. If the header is not present the response body will be
inspected using byte_size/1.
Note for %h: The hostname will always be the ip of the client (same as %a).
Note for %l: Always a dash ("-").
Note for %T: Rounding happens, so "0.6 seconds" will be reported as "1 second".
Note for %{UNIT}T: Available units are s for seconds (same as %T),
ms for milliseconds (same as M) and us for microseconds (same as %D).
Note for %V: Alias for %v.