Generated script tag
Standard non-Core installation generates script tag
When you install JSNLog using one of the non-Core Nuget packages JSNLog.Log4Net, JSNLog.NLog, JSNLog.Elmah, JSNLog.Serilog or JSNLog.CommonLogging, two things happen:
Among other things, it adds a
tag to your web.config,
containing the location of your jsnlog.js file:
<jsnlog productionLibraryPath="~/Scripts/jsnlog.min.js"> </jsnlog>
- The installation page will have suggested you include a call to the Configure method in your pages (exceptions). That method inserts a <script> tag that loads the jsnlog.min.js file. It uses the url from the productionLibraryPath property. You can verify this by doing a View Source of the page.
Generating script tags with Core applications
install JSNLog in a .Net Core project
In this case, to have the <script> tag generated for you:
- The UseJSNLog method called in your Startup.cs file takes an JsnlogConfiguration object. Set its productionLibraryPath attribute to the url you want to use in the <script> tag.
Stopping automatic generation of the script tag
If you want to load the jsnlog.min.js file yourself, for example as part of a bundle or as an AMD module, you don't want the generated <script> tag.
You can make it go away by simply not setting the productionLibraryPath attribute.