View Source Zexbox.Logging (Zexbox v0.8.0)

This module is responsible for attaching logging to telemetry events.

Summary

Functions

Attaches logging to the Phoenix endpoint stop and start events. By default will be attached on supervisor startup

Attaches logging to the given event with the given params.

Functions

Link to this function

attach_controller_logs()

View Source
@spec attach_controller_logs() :: :ok

Attaches logging to the Phoenix endpoint stop and start events. By default will be attached on supervisor startup

Link to this function

attach_telemetry(event, params, function)

View Source
@spec attach_telemetry(
  event_name :: binary(),
  event_params :: [atom()],
  callback :: (any(), any(), any(), any() -> any())
) :: :ok

Attaches logging to the given event with the given params.

Note: The logs will only be attached if the application environment variable :capture_telemetry_log_events is set to true.

Examples

iex> Zexbox.Logging.attach_telemetry(:my_event, [:my, :event], &MyAppHandler.my_handler/3)
:ok