1

We are using Asp.net Web API 2 - Server side Angular 4 in client side (angular-cli) We have integrated Elmah on the server side for error handling. We have integrated Jsnlog in the client side.

Our angular released version is hosted in http://ng.local.com and API released version is hotsed in http://api.local.com/. Now, We have gone through the docs of Jsnlog configuration. But, facing issue in error posting to the server (to our api released http://api.local.com/) i.e missing some configuration.

Can anyone know the configuration for Jsnlog to have the URL of the API server.

Prashant Kankhara
  • 1,498
  • 4
  • 15
  • 30

1 Answers1

0

There is information found here to configure the endpoint for JSNLog. Take a look at the "Configuring JSNLog" Section of this page (http://jsnlog.com/Documentation/HowTo/Angular2Logging and http://jsnlog.com/Documentation/JSNLogJs/AjaxAppender/SetOptions).

But to summarize, just add this line to your app.module.ts before the @NgModule({...

// Set the endpoint for JSNLog.

JL().setOptions({ 'appenders': [JL.createAjaxAppender('example appender').setOptions({'url': [Your Desired Endpoint Address] + '/jsnlog.logger'})] });

@NgModule({
...
txavier
  • 481
  • 4
  • 6