Change to javascript to get the log entries? Error 502 reported.
Opened this issue · 0 comments
dougbass commented
Thanks for the great idea. I implemented the java code as suggested and it works great, and I can see changes to the log file by hitting the http://localhost:8080/logs url in my browser.
I am now trying integrate into my web app using the following javascript code but it never seems to show any data. Any ideas?
` const evtSource = new EventSource(AP._hostOrigin+'/logs', { withCredentials: true } );
evtSource.onmessage = (event) => {
console.log(JSON.stringify(event))
AJS.$("#logs").append(event.data);
};
And the error reported in the browser console is: Failed to load resource: the server responded with a status of 502 ()
`