Exemplo n.º 1
0
        protected override void Write(LogEventInfo logEvent)
        {
            var logMessage = Layout.Render(logEvent);

            SendMessageToSlack(new SlackMessage
            {
                attachments = new List <SlackAttachment>
                {
                    new SlackAttachment
                    {
                        title      = logEvent.LoggerName,
                        title_link = BlobHelper.BuildBlobUrlFromLogEvent(TestEnvironment.AzureStorage, logEvent),
                        text       = logMessage,
                        fallback   = logMessage,
                        color      = "danger"
                    },
                    new SlackAttachment
                    {
                        text = (new SimpleLayout(StackTraceLayout)).Render(logEvent)
                    }
                }
            });
        }