class ActionController::LogHandler

Overview

A handler that logs the request method, resource, status code, and the time taken to execute.

Included Modules

Defined in:

action-controller/log_handler.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(filter : Array(String) = [] of String, log : ActionController::LogHandler::Event = Event::Response, ms : Bool = false) #

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.


[View source]

Instance Method Detail

def call(context : HTTP::Server::Context) : Nil #

[View source]