A :telemetry event listener that produces logs for events emitted by Crown.
Usage
Crown.attach_default_logger()
Crown.attach_default_logger(min_log_level: :warning)
Crown.attach_default_logger(prefixes: [[:crown, :leadership]])Events
[:crown, :child, :exited]with a log level of:error[:crown, :child, :started]with a log level of:info[:crown, :child, :stopped]with a log level of:info[:crown, :leadership, :claimed]with a log level of:info[:crown, :leadership, :conflict]with a log level of:warning[:crown, :leadership, :duplicate_leader]with a log level of:warning[:crown, :leadership, :invalid_claim]with a log level of:error[:crown, :leadership, :lost]with a log level of:warning[:crown, :leadership, :refreshed]with a log level of:debug[:crown, :leadership, :rejected]with a log level of:info[:crown, :monitor, :failed]with a log level of:warning[:crown, :monitor, :leader_down]with a log level of:warning[:crown, :monitor, :started]with a log level of:info[:crown, :monitor, :timeout]with a log level of:warning[:crown, :oracle, :oban, :query_error]with a log level of:warning[:crown, :oracle, :postgres_lease, :table_initialized]with a log level of:debug[:crown, :process, :initialized]with a log level of:info[:crown, :process, :terminating]with a log level of:info[:crown, :process, :unexpected_info]with a log level of:warning
Summary
Functions
Attaches the logging handler to Crown's telemetry events.
Returns the list of telemetry event names emitted by Crown.
Functions
Attaches the logging handler to Crown's telemetry events.
With no argument every event is logged at its predefined level. filters
narrows what gets attached:
:min_log_level- only attach events whose level is at or above this level (:debug,:info,:warning,:error).:prefixes- a list of event-name prefixes; only events whose name starts with one of them are attached, e.g.[[:crown, :leadership]].
Returns :ok. Usually called through Crown.attach_default_logger/1.
Returns the list of telemetry event names emitted by Crown.