View Source DiscoLog.Config (disco_log v0.7.0)

Configuration related module for DiscoLog.

Configuration Schema

  • :otp_app (atom/0) - Required. Name of your application

  • :token (String.t/0) - Required. Your Discord bot token

  • :guild_id (String.t/0) - Required. Discord Server ID

  • :category_id (String.t/0) - Required. Category (Channel) ID

  • :occurrences_channel_id (String.t/0) - Required. Forum channel ID for error occurrences

  • :occurrences_channel_tags (map of String.t/0 keys and String.t/0 values) - Required. Map with IDs for "plug", "live_view" and "oban" tags

  • :info_channel_id (String.t/0) - Required. Text channel ID for info-level logs

  • :error_channel_id (String.t/0) - Required. Text channel ID for logs higher than info-level logs

  • :enable (boolean/0) - Automatically start DiscoLog? The default value is true.

  • :enable_logger (boolean/0) - Automatically attach logger handler? The default value is true.

  • :enable_discord_log (boolean/0) - Logs requests to Discord API? The default value is false.

  • :instrument_oban (boolean/0) - Automatically instrument Oban? The default value is true.

  • :instrument_phoenix (boolean/0) - Automatically instrument Phoenix? The default value is true.

  • :instrument_tesla (boolean/0) - Automatically instrument Tesla? The default value is true.

  • :metadata (list of atom/0) - List of Logger metadata keys to propagate with the message The default value is [].

  • :excluded_domains (list of atom/0) - Logs with domains from this list will be ignored The default value is [:cowboy, :bandit].

  • :before_send - This callback will be called with error or {message, metadata} tuple as argument before it is sent The default value is nil.

  • :discord (atom/0) - Discord client to use The default value is DiscoLog.Discord.

  • :supervisor_name (atom/0) - Name of the supervisor process running DiscoLog The default value is DiscoLog.

Summary

Functions

Reads and validates config from global application configuration

Validates configuration against the schema

Types

config()

@type config() :: map()

Functions

read!()

@spec read!() :: config()

Reads and validates config from global application configuration

validate(config)

@spec validate(options :: keyword() | map()) ::
  {:ok, config()} | {:error, NimbleOptions.ValidationError.t()}

Validates configuration against the schema

validate!(options)

@spec validate!(options :: keyword() | map()) :: config()

See validate/1