我们在客户端使用Asp.net Web API2-服务器端Angular 4 (angular-cli)我们在服务器端集成了Elmah来进行错误处理。我们在客户端集成了Jsnlog。
我们的angular发布版本托管在http://ng.local.com中,API发布版本在http://api.local.com/中是hotsed的。现在,我们已经浏览了Jsnlog配置文档。但是,在错误发布到服务器(发布到我们的api发布的http://api.local.com/)时遇到了问题,即丢失了一些配置。
是否有人知道Jsnlog的配置,以便拥有API服务器的URL。
发布于 2018-07-23 21:14:47
此处提供了为JSNLog配置端点的信息。请看一下本页面的“配置JSNLog”部分(http://jsnlog.com/Documentation/HowTo/Angular2Logging和http://jsnlog.com/Documentation/JSNLogJs/AjaxAppender/SetOptions)。
但总而言之,只需将此行添加到您的app.module.ts中@NgModule({...
// Set the endpoint for JSNLog.
JL().setOptions({ 'appenders': [JL.createAjaxAppender('example appender').setOptions({'url': [Your Desired Endpoint Address] + '/jsnlog.logger'})] });
@NgModule({
...https://stackoverflow.com/questions/46258110
复制相似问题