class ActionController::LogHandler
- ActionController::LogHandler
- Reference
- Object
Overview
A handler that logs the request method, resource, status code, and the time taken to execute.
Included Modules
- HTTP::Handler
Defined in:
action-controller/log_handler.crConstructors
-
.new(filter : Array(String) = [] of String, log : ActionController::LogHandler::Event = Event::Response, ms : Bool = false)
Creates a new
LogHandler
for inserting into middlewhere.
Instance Method Summary
Constructor Detail
Creates a new LogHandler
for inserting into middlewhere.
Use filter to specified any keys that may appear in request params that should be redacted prior to passing to the logging backend. This may include secrets or PII that should not leave the bounds of this system.
log can be used to specify what sections of the request lifecycle to log. The defaults to the response (either valid or error) only, however support is also provide for request entry logging for development environments.
By default, request times will include a unit. Set ms to instead always use milliseconds for simpler external perf monitoring.