项目作者: jonfreeland

项目描述 :
Simple, asynchronous Slack log4net appender.
高级语言: C#
项目地址: git://github.com/jonfreeland/Log4Slack.git
创建时间: 2014-08-16T02:58:01Z
项目社区:https://github.com/jonfreeland/Log4Slack

开源协议:MIT License

下载


Log4Slack

Simple, asynchronous Slack log4net appender. Grab the NuGet package here.

Example Log4Slack output

  1. <appender name="SlackAppender" type="Log4Slack.SlackAppender, Log4Slack">
  2. <WebhookUrl value="https://{your company}.slack.com/services/hooks/incoming-webhook?token={your token}" ></WebhookUrl> <!-- Your Slack webhook URL -->
  3. <Channel value="#testing" ></Channel> <!-- Your Slack channel to post to -->
  4. <Username value="Log4Slack" ></Username> <!-- The username to post as -->
  5. <IconUrl value="{your icon url}" ></IconUrl>
  6. <IconEmoji value=":ghost:" ></IconEmoji> <!-- Include an emoji to add a little character to your message -->
  7. <AddAttachment value="true" ></AddAttachment> <!-- Include an attachment on the Slack message with additional details -->
  8. <AddExceptionTraceField value="true" ></AddExceptionTraceField> <!-- If an exception occurs, add its trace as a field on the message attachment -->
  9. <UsernameAppendLoggerName value="true"></UsernameAppendLoggerName> <!-- Append the current logger name to the Slack username -->
  10. <LinkNames value="false" /> <!-- Automatically link @mentions -->
  11. <Proxy value="http://proxy:8000"></Proxy> <!-- Use an outgoing http proxy -->
  12. <mapping> <!-- Add custom colors on the attachment -->
  13. <level value="INFO" ></level>
  14. <backColor value="SkyBlue" ></backColor>
  15. </mapping>
  16. </appender>