Skip to content

Instantly share code, notes, and snippets.

@apkd
Last active January 12, 2017 20:10
Show Gist options
  • Save apkd/58b3eba36ef9511c8fd7c9cc4399e49b to your computer and use it in GitHub Desktop.
Save apkd/58b3eba36ef9511c8fd7c9cc4399e49b to your computer and use it in GitHub Desktop.
using System;
using Serilog;
using Narochno.Serilog.Slack;
namespace SlackSinkWithDiscordExample
{
class Program
{
const string discord_webhook =
"https://discordapp.com/api/webhooks/{REDACTED}";
static void Main(string[] args)
{
Serilog.Debugging.SelfLog.Enable(Console.Out);
var discord_verbose = new Narochno.Slack.SlackConfig()
{
WebHookUrl = discord_webhook + "/slack",
};
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Slack(discord_verbose)
.CreateLogger();
Log.Debug("Test Message");
Console.ReadLine();
}
}
}
2017-01-12T19:58:16.1999340Z Exception while emitting periodic batch from Narochno.Serilog.Slack.SlackBatchingSink: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatch(IEnumerable`1 events)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
---> (Inner Exception #0) System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()<---
2017-01-12T19:58:17.4418961Z Exception while emitting periodic batch from Narochno.Serilog.Slack.SlackBatchingSink: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatch(IEnumerable`1 events)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
---> (Inner Exception #0) System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()<---
2017-01-12T19:58:27.6534690Z Exception while emitting periodic batch from Narochno.Serilog.Slack.SlackBatchingSink: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatch(IEnumerable`1 events)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
---> (Inner Exception #0) System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()<---
2017-01-12T19:58:48.8230049Z Exception while emitting periodic batch from Narochno.Serilog.Slack.SlackBatchingSink: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatch(IEnumerable`1 events)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
---> (Inner Exception #0) System.ArgumentException: Requested value '{"attachments": [["fields"]]}' was not found.
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Narochno.Primitives.Parsing.Parsers.EnumParser`1.Parse(String input)
at Narochno.Primitives.Parsing.Parser`1.Narochno.Primitives.Parsing.IParser.Parse(String input)
at Narochno.Primitives.Parsing.StringExtensions.Parse[TType](String input)
at Narochno.Slack.SlackClient.<PostMessage>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Narochno.Serilog.Slack.SlackBatchingSink.<EmitBatchAsync>d__3.MoveNext()<---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment