Documentation Menu

Configure Method

Generates JavaScript code to configure JavaScript loggers and appenders.


public static string Configure(string requestId = null)


requestId 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.


If you use ASP.NET Core, do not use this method. Instead, use the jl-javascript-logger-definitions tag helper.

As part of the installation, you will have included a call to this method 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.