Target Slack - Hooch180/NLogGwoKusExtensions Wiki

Slack Target

Target to send messages to slack channel using Slack Bot. Bot needs to be invited into channel.

Parameters

Required:

  • SlackDomain - Your slack domain. https://domain.slack.com/
  • ApiKey - Your bot ApiKey. Found in bot preferences page. Format "xxxx-xxxxxxxx-xxxxxxxx-xxxxx".
  • Channel - Channel name without leading [#] or channel Id.

Optional

  • UserName - Bot username. This name will appear as bot name in chat.
  • Emoji - Emoji name with leading and trailing colon to set as bot avatar.
  • IconUrl - Icon URL to set as bot avatar. Emoji must be not set for this to work.
  • ThrowExceptions - If set to true exceptions are thrown to NLog framework for logging. Default is false.

Examples

Only required parameters:

<targets>
  <target type="SlackBotTarget" name="s" 
          SlackDomain="domain" 
          ApiKey="xxxx-xxxxxxxx-xxxxxxxx-xxxxx" 
          Channel="general" />
</targets>

All parameters:

<targets>
  <target type="SlackBotTarget" name="s" 
          SlackDomain="domain" 
          ApiKey="xxxx-xxxxxxxx-xxxxxxxx-xxxxx" 
          Channel="general"
          UserName="CustomUserName"
          Emoji=":warning:"
          IconUrl="Delete Emoji if you want to use it."
          ThrowExceptions="false|true" />
</targets>
⚠️ **GitHub.com Fallback** ⚠️