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    

Questions

Ask A Question
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 9 months ago

1

Docker-.Net Core-Mac vs Linux

Hello, I would like to use seq in a .net core api. I use this code to configure uri: .WriteTo.Seq("http://<ubuntuip>:5341") First I started the seq in docker at my digitalocean droplet (<ubuntuip>) at port 5341. I can reach the ui from chrome. Then I built a docker image from my .net core app and run this image at my local computer and the logging working fine. Then I pushed this image to dockerhub and run it at my droplet and the logging not working. So I run the same docker image at my droplet and on my computer, the seq run at my droplet and if I run app on my local computer the logging fine but when on droplet that's not working. Can anyone help me? And this is the seq logging error message: Exception while emitting periodic batch from Serilog.Sinks.Seq.SeqSink: System.Threading.Tasks.TaskCanceledException: The operation was canceled. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Serilog.Sinks.Seq.SeqSink.EmitBatchAsync(IEnumerable`1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()

Posted by Tom 10 months ago