April 15, 2015 by Matija Tomašković in Engine
In web applications, typically logging is done on web server. However, if there are errors in JavaScript code in web browser such errors are only visible to end user using web browser. Depending on web browser and web browser settings end user might be alerted with confusing error message or such error will be "invisible" for user ending up in console log which is typically not visible to end user.
Evolution web client logging is mechanism for handling JavaScript logging and catching JavaScript errors which sends client log to server for easier detection and analysis of such errors. It is using HTML5 Local storage feature to store small portions of log and is using regular user AJAX requests to send parts of client log without making additional AJAX requests to server just for sending log lines.
Figure 1. Sample of JavaScript error – e.g. problem in code handling click on checkbox in grid
Figure 2. Web browser client logging configuration
Suppose that there is JavaScript error which happens on GUI form ProjectIssues when user clicks checkbox (see Figure 1.)
Such JavaScript errors are catched in window.onerror handler of Evolution client Log if web client logging is configured to be enabled. If sending to server is also enabled then Evolution JavaScript log will send client to to server where these lines will be copied to server log file and to "All messages" section visible also on Evolution daily report.
Figure 3. Web client logging configuration
You can find web client warning/errors in menu option ADMINISTRATION > All messages.
Error subject contains text "(WEB CLIENT)".
Figure 4. Sample client errors
For every web client warning/error you can see:
When you open client warning/error message, you should see more details and check description:
Figure 5. Client error details
In error description you should see:
In main server evolution log you should be able to find same ID:
Figure 6. Server log having request with same REQ ID
Having CREQ ID from warning/error message and exact time of client error, you should now open client log and search for more details.
Client log is placed in Evolution log folder on web server and has default name "epis_client.log".
Figure 7. Evolution log folder having web client log
In this log you should now search for CREQ ID.
First line is most important, it is logged by server when rendering initial HTML of GUI form. This line has "(server)" marker and says for which user and which GUI form is this about:
Figure 8. Client log for CREQ ID – first line
E.g. it says that user #4 opened form ProjectIssues.
Next lines are log lines from web browser i.e. logged in JavaScript:
Figure 9. Client log for CREQ ID
Here you can see that same error logged.
If there is problem in GUI cached JavaScript, you can analyse it like this:
Figure 10. GUI engine JavaScript with line reporting error
Figure 11. Name of actual JavaScript file
You should now have all information you need to resolve this JavaScript error.