Documentation Menu


Tag helper that generates JavaScript code to configure loggers and appenders.


<jl-javascript-logger-definitions request-id="..." />


request-id Optional. Request id to include in log messages sent by JSNLog to the server. See remarks.

Return Value

Script blocks that configure your JavaScript loggers and appenders.


This can only be used in ASP.NET Core web applications.

As part of the installation, you will have included a call to this tag helper in your pages (exceptions).

It translates the server side configuration to JavaScript code that configures the client side loggers and appenders (details).


JSNLog gets the request id of the request, or if it can't, generates its own unique id. It sends that with all log messages to the server so log messages belonging to the same request can be correlated (details).

If however you generate your own request ids and you want JSNLog to use that instead, pass in your request id.