Version 9.8
 —  Web Application Development  —

JavaScript Logger Engine

The JavaScript logger engine is used to log JavaScript errors (primarily) as well as to debug specific modules of the JavaScript engine. The engine logs JavaScript errors which occur to users of the Web application. These errors are logged to the framework JavaScript log, with the following user information: Session ID, IP, browser details.

Each line in the log displays a timestamp, module name, log level, and the message.

Logging JavaScript Errors

The JavaScript logger engine automatically logs JavaScript errors to a log text file on the server (logs/javascript_log.txt).

Note:
Applications created in ApplinX versions prior to 5.2.4 this file should be replaced/edited (if changes were made) with the config/gx_logConfig.xml file from the new application/config directory of the relevant framework type jsp/c#/vb.

Debugging JavaScript Modules

The JavaScript Logger Engine can be used by ApplinX developers to debug specific modules of the JavaScript engine (The JavaScript engine core, Emulation, modal windows, type ahead, Natural data transfer), by displaying the information in the log console (or writing to the server log when the log console is not shown).

To configure the JavaScript log console, configure parameters in the config/gx_clientConfig.xml file as follows:

<engineConfig
logLevel="3" <- 3-activate debug mode (0-Error , 1-Warnings , 2-Massage , 3-Debug)
debugModules=:z_engine.js,z_emulator.js,z_window.js,z_typeAhead,z_ndt.js" <- which modules to debug
showLogConsole="true" <- show/hide the log console
/>

Note:
The log text file also logs any error/debug (when active) messages when the browser is refreshed, when the system is disconnected, when clicking on the Write to server log button in the log console (if the log console is displayed) and when the log console’s size reaches 5k (to avoid reducing the speed of the browser).

Example:

Whenever myFunc is executed the Boolean variable "myBool" is evaluated. If the value received is "false", a message is logged in the debug log stating that there is a problem.

function myFunc(){
      var myBool = false;
      doSomthing(myBool);
      if (!myBool){
       GXLog.debug("myModule","Something went terribly wrong!!");
      }
      return myBool;
}

Ensure to set the config/gx_clientConfig.xml as detailed above.

Refer to the API:

Top of page