mw_log: Log requests to the standard output or other connection

Description Usage Arguments Value See Also Examples

View source: R/mw-log.R

Description

A one line log entry for every request. The output looks like this:

1
GET http://127.0.0.1:3000/image 200 3 ms - 4742

and contains

Usage

1
mw_log(format = "dev", stream = stdout())

Arguments

format

Log format. Not implemented currently.

stream

R connection to log to. Defaults to stdout(), the standard output.

Value

Handler function.

See Also

Other middleware: mw_etag(), mw_json(), mw_multipart(), mw_raw(), mw_static(), mw_text(), mw_urlencoded()

Examples

1
2
3
app <- new_app()
app$use(mw_log())
app

presser documentation built on July 1, 2020, 5:49 p.m.