-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I have written code as below in react native. But I am seeing only one message(very first message) in the server.
Any consecutive requesting fails with [Error: Cannot open, already sending]
import {JL} from 'jsnlog'
var app = JL.createAjaxAppender("appender").setOptions({
'url': 'http://127.0.0.1:8080/log'
});
JL().setOptions({
"appenders": [app]
});
class App extends React.Component {
componentDidMount () {
JL().info('Application started')
JL()..debug('Application started with no config')
}
render() {
return(
<div className ="container-fluid">
<Header />
<Switch>
<Route exact path ="/" component ={HomePage} />
<Route path ="/about" component ={AboutPage} />
<Route path ="/courses" component ={CoursesPage} />
<Route component={PageNotFound} />
</Switch>
</div>
)
}
}
export default App;
Temporarily, we tried re-initialized XHR object inside the
AjaxAppender.prototype.sendLogItemsAjax = function (logItems, successCallback) {
this.xhr = JL._createXMLHttpRequest()
// rest of the code
}```
Metadata
Metadata
Assignees
Labels
No labels