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 ofString.t/0
keys andString.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 istrue
.:enable_logger
(boolean/0
) - Automatically attach logger handler? The default value istrue
.:enable_discord_log
(boolean/0
) - Logs requests to Discord API? The default value isfalse
.:instrument_oban
(boolean/0
) - Automatically instrument Oban? The default value istrue
.:instrument_phoenix
(boolean/0
) - Automatically instrument Phoenix? The default value istrue
.:instrument_tesla
(boolean/0
) - Automatically instrument Tesla? The default value istrue
.:metadata
(list ofatom/0
) - List of Logger metadata keys to propagate with the message The default value is[]
.:excluded_domains
(list ofatom/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 isnil
.:discord
(atom/0
) - Discord client to use The default value isDiscoLog.Discord
.:supervisor_name
(atom/0
) - Name of the supervisor process running DiscoLog The default value isDiscoLog
.
Summary
Functions
Reads and validates config from global application configuration
Validates configuration against the schema
Types
@type config() :: map()
Functions
@spec read!() :: config()
Reads and validates config from global application configuration
@spec validate(options :: keyword() | map()) :: {:ok, config()} | {:error, NimbleOptions.ValidationError.t()}
Validates configuration against the schema
See validate/1