Seq Documentation and Support

Welcome to the Seq documentation hub. You'll find comprehensive guides and documentation to help you start working with Seq as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Ask A Question

Questions

3

Cannot log to Seq from Serilog with .NET Core 3.1

Hi I cannot log to Seq when targeting .NET Core 3.1 in any type of application. Below is a sample Console application which illustrates the issue. class Program { static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .WriteTo.Seq("http://localhost:5341") .WriteTo.Console() .AuditTo.Seq("http://localhost:5341") .CreateLogger(); Serilog.Debugging.SelfLog.Enable(Console.Error); Log.Information("Testing from Console"); try { Console.WriteLine("Hello World!"); } finally { Log.CloseAndFlush(); } } } [16:47:37 INF] Testing from Console 2020-10-14T06:47:37.2569282Z Exception while emitting periodic batch from Serilog.Sinks.Seq.SeqSink: Serilog.Debugging.LoggingFailedException: Received failed result NotFound when posting events to Seq at Serilog.Sinks.Seq.SeqSink.EmitBatchAsync(IEnumerable`1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick() 2020-10-14T06:47:37.2569282Z Caught exception while emitting to sink Serilog.Sinks.Seq.Audit.SeqAuditSink: System.AggregateException: One or more errors occurred. (Received failed result NotFound when posting events to Seq) ---> Serilog.Debugging.LoggingFailedException: Received failed result NotFound when posting events to Seq at Serilog.Sinks.Seq.Audit.SeqAuditSink.EmitAsync(LogEvent logEvent) --- 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 System.Threading.Tasks.Task.Wait() at Serilog.Sinks.Seq.Audit.SeqAuditSink.Emit(LogEvent logEvent) at Serilog.Core.Sinks.AggregateSink.Emit(LogEvent logEvent) Unhandled exception. System.AggregateException: Failed to emit a log event. (One or more errors occurred. (Received failed result NotFound when posting events to Seq)) ---> System.AggregateException: One or more errors occurred. (Received failed result NotFound when posting events to Seq) ---> Serilog.Debugging.LoggingFailedException: Received failed result NotFound when posting events to Seq at Serilog.Sinks.Seq.Audit.SeqAuditSink.EmitAsync(LogEvent logEvent) --- 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 System.Threading.Tasks.Task.Wait() at Serilog.Sinks.Seq.Audit.SeqAuditSink.Emit(LogEvent logEvent) at Serilog.Core.Sinks.AggregateSink.Emit(LogEvent logEvent) --- End of inner exception stack trace --- at Serilog.Core.Sinks.AggregateSink.Emit(LogEvent logEvent) at Serilog.Core.Logger.Dispatch(LogEvent logEvent) at Serilog.Core.Logger.Write(LogEventLevel level, Exception exception, String messageTemplate, Object[] propertyValues) at Serilog.Core.Logger.Write(LogEventLevel level, String messageTemplate, Object[] propertyValues) at Serilog.Core.Logger.Write(LogEventLevel level, String messageTemplate) at Serilog.Log.Write(LogEventLevel level, String messageTemplate) at Serilog.Log.Information(String messageTemplate) at TestSEQ_VS2019_Console.Program.Main(String[] args) in C:\Code\Mine\Testing\C# Testing\TestSEQ_VS2019_Console\TestSEQ_VS2019_Console\Program.cs:line 20 There seems to be a common issue of "Not Found" error but I cannot glean any further details. My Seq instance is working and from a browser I can navigate to http://localhost:5341 ok I am using v4.2.1113 as I am on Windows 7. The output shows the Console sink works fine (and i've also successfully tried File too). If I change the target framework to .NET Core 2.1 it works fine. Can you point me to any issue or help me know where to possibly find where the issue is? Thanks

Posted by Jason 15 days ago