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



NullReferenceException in response when Seqlog posts to the raw events end-point

Hi. I'm the maintainer of the [Seqlog]( library for Python. I only have a license for Seq 4.x so I haven't tried this myself, but [from what users tell me](, it seems that something has changed in Seq 5.x and when they attempt to use it with the latest version they see the following error (with an HTTP 500 from Seq): ```json { "@t": "2018-11-18T06:10:09.6170577Z", "@mt": "HTTP {RequestMethod} {RequestPath} responded {StatusCode} in {Elapsed:0.0000} ms", "@r": ["0.6036"], "@l": "Error", "@x": "System.NullReferenceException: Object reference not set to an instance of an object.\n at Seq.Server.Web.Api.RawEventsController.TryParseBody(ApiKey apiKey, StorageEventCreationData[]& events, String& errorMessage)\n at Seq.Server.Web.Api.RawEventsController.Ingest()\n at lambda_method(Closure , Object , Object[] )\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()\n at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)\n at Seq.Server.Web.Middleware.WebSocketAcceptMiddleware.Invoke(HttpContext context)\n at Seq.Server.Web.Middleware.RequestAuthenticationMiddleware.Invoke(HttpContext httpContext)\n at Seq.Server.Web.Middleware.BrowserSecurityOptionsMiddleware.Invoke(HttpContext context)\n at Seq.Server.Web.Middleware.RequestCompletionMiddleware.Invoke(HttpContext httpContext)", "RequestMethod": "POST", "RequestPath": "/api/events/raw", "StatusCode": 500, "Elapsed": 0.6036, "ErrorToken": "b2c14ff04fbc42348e951aec12f7f637", "RequestProtocol": "HTTP/1.1", "RequestHost": "localhost:5341", "RequestHeaders": { "User-Agent": "python-requests/2.18.4", "Content-Length": "1103" }, "SourceContext": "Seq.Server.Web.Middleware.RequestCompletionMiddleware", "RequestId": "0HLIC0HN27AR5:00000001", "CorrelationId": null, "ConnectionId": "0HLIC0HN27AR5" } ``` The request body is: ```json { "Events": [ { "Timestamp": "2018-11-17 09:05:47.256725+02:00", "Level": "INFO", "MessageTemplate": "Hi, {name}. {greeting}", "Properties": { "MachineName": "IL-GZigelman", "ProcessId": 17860, "LoggerName": "root", "name": "Root logger", "greeting": "Nice to meet you", "ThreadId": 20616, "ThreadName": "MainThread" } }, { "Timestamp": "2018-11-17 09:05:47.256725+02:00", "Level": "INFO", "MessageTemplate": "Hi, {name}! {greeting}", "Properties": { "MachineName": "IL-GZigelman", "ProcessId": 17860, "LoggerName": "A", "name": "world", "greeting": "Nice to meet you", "ThreadId": 20616, "ThreadName": "MainThread" } }, { "Timestamp": "2018-11-17 09:05:47.256725+02:00", "Level": "INFO", "MessageTemplate": "Bye, {name}! {greeting}", "Properties": { "MachineName": "IL-GZigelman", "ProcessId": 17860, "LoggerName": "A.B", "name": "moon", "greeting": "Nice to meet you", "ThreadId": 20616, "ThreadName": "MainThread" } }, { "Timestamp": "2018-11-17 09:05:47.256725+02:00", "Level": "INFO", "MessageTemplate": "By, moon!", "Properties": { "MachineName": "IL-GZigelman", "ProcessId": 17860, "LoggerName": "C", "0": "moon" } } ] } ```

Posted by Adam Friedman 2 years ago


Is NLog Exception layout renderer supported?

Seq version: 5.0.2296 NLog version: 4.5.11 NLog.Targets.Seq version: 1.0.0 Hi! I'm using NLog integration, everything works perfect. I'm logging exceptions with this syntax, as explained here: logger.Error(ex, ex.Message); This causes the full exception showed in Seq dashboard, which is what I needed: Now I want to make sure the inner exceptions to be included in that information, so I wanted to add this Exception layout renderer: ${exception:format=toString,Data:maxInnerExceptionLevel=10} as explained here: In a plain NLog configuration file, I would add that Exception Layout Rendered like this: <targets> <target name="f" type="File" layout="${longdate} ${message} ${exception:format=tostring}"/> </targets> But I have tried adding it to my Seq target tags, and the logs are not written. My actual targets definition is: <targets> <target name="seq" xsi:type="BufferingWrapper" bufferSize="1000" flushTimeout="2000" > <target xsi:type="Seq" serverUrl="http://localhost:5341" apiKey="" > <property name="application" value="${appdomain:format={1\}" /> <property name="class" value="${callsite:className=true:fileName=false:includeSourcePath=false:methodName=false}" /> <property name="method" value="${callsite:className=false:fileName=false:includeSourcePath=false:methodName=true}" /> </target> </target> </targets>

Posted by Carolina 2 years ago