On this page:
top
up

2.9LoggingπŸ”— i

package: web-server-lib
The web-server/dispatchers/dispatch-logresp module defines a dispatcher constructor for transparent logging of requests and responses.
Equivalent to (or/c (-> request? string? )(-> request? response? string? )).

Formats a request and a response by:
"~s\n"
(list 'from(request-client-ip req)
'to(request-host-ip req)
'code(response-code resp)))

Formats a request and a response by:
"~s\n"
`((client-ip,(request-client-ip req))
(host-ip,(request-host-ip req))
(referer
#"Referer"
(if R
#f)))
(uri,(url->string (request-uri req)))
(time,(current-seconds ))
(code,(response-code resp))))

Formats a request and a response like Apache’s default. However, Apache’s default includes information about the size of the object returned to the client, which this function does not have access to, so it defaults the last field to -.

Formats a request and a response to approximate the Combined Log Format. As this function does not have access to the size of the object returned to the client, it defaults the field to -.

Equivalent to (symbols 'parenthesized-default'extended'apache-default'combined).

Maps 'parenthesized-default to paren-format , 'extended to extended-format , 'apache-default to apache-default-format , and 'combined to combined-log-format

procedure

( make [ #:formatformat
#:log-pathlog-path]
dispatcher)dispatcher/c
log-path:(or/c path-string? output-port? )="log"
dispatcher:dispatcher/c
If dispatcher is successfully dispatched, logs requests and responses (without the body information) to log-path, which can be either a filepath or an output-port? , using format to format the requests and responses (or just requests if format only accepts one argument). If format is a symbol, a log formatter will be tacitly made using log-format->format .

Added in version 1.12 of package web-server-lib.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /