View Source Vigil.LogFormatter (vigil v0.4.4)

A specialized log formatter for Vigil

Link to this section Summary

Functions

This function is intended to be used throughout the plug (including in callbacks) to log any exceptions as they occur.

Link to this section Functions

Link to this function

log(conn, errors \\ nil, opts)

View Source
@spec log(conn :: Plug.Conn.t(), errors :: term(), opts :: keyword() | map()) :: :ok

This function is intended to be used throughout the plug (including in callbacks) to log any exceptions as they occur.

It is neccessary to abstract this away into its own function because the sanitize module will be called outside of the general try/rescue at the root of the plug, because it is implemented as a callback.

This function allows us to have the same logging schema accross the entire plug, even though we can't make guarantees about when certain modules will be called or in what context.