Enabling browser logging in a Digital Service application
BMC Helix Innovation Studio provides logging capabilities that you can use to track the activities and debug issues with the Digital Service application. The logs provide information about the actions invoked in the client during interactions with an application. All the log messages are logged to the browser console. You can view all the server logs and user interface logs in the browser console by adding debug parameter to an application URL.
To enable logging in code-based applications
- In the application, to open the browser console, press F12.
- On the browser console, navigate to the Console tab.
- Add ?debug parameter in the application URL.
For example, http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug#/approval/console
The logs are populated in the browser console. To get the logger, use ServiceLocator from com.bmc.arsys.rx.application.common and use getLogger() function.
You will get a com.bmc.arsys.rx.services.common.Logger and method like Logger.info can be used to log.
For example:
public Logger getLogger() {
if (logger == null) {
logger = ServiceLocator.getLogger();
}
return logger;
}
getLogger().info(“Custom message to log”)
To enable logging in codeless applications
- In the application, to open the browser console, press F12.
- On the browser console, navigate to the Console tab.
- Add ?debug parameter in the application URL as follows:
http://<server>:<jetty port>/innovationstudio/index.html?debug#/BUNDLEID/view/BUNDLEID.VIEWNAME
For example, http://<server>:<jetty port>/innovationstudio/index.html?debug#/com.example.MyApp/view/com.bmc.arsys.rx.approval:Approval%20Console
The logs are populated in the browser console.
Logging levels
You can specify the following logging levels in the debug parameter to filter the log messages:
Logging level | Description | Example (code-based application) |
---|---|---|
Server logs | ||
sql | Logs SQL logs executed on the server | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=sql#/approval/console |
api | Logs server API messages to the console | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=api#/approval/console |
rule | Logs rules execution information to the console | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=rule#/approval/console |
process | Logs processes execution information to the console | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=process#/approval/console |
debug | Logs messages when any of the following events occurs:
| http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=debug#/approval/console |
bundle | Logs all the messages for the custom code | http://<server>:<jetty-port>/com.example.taskmanager/index.html?debug=bundle#/bx/view/com.example.taskmanager
|
Client logs | ||
info | Logs messages of information level from the application. | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=info#/approval/console |
warning | Logs warning messages from the server or messages logged from the application. | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=warning#/approval/console |
error | Logs error messages when any request fails or client code errors occur. | http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=error#/approval/console |
To add multiple logging levels to the debug parameter, separate the logging levels using comma. For example, to enable server logging level and info level, specify the logging levels in the URL as follows:
http://<server>:<jetty port>/com.bmc.arsys.rx.approval/index.html?debug=api,sql,info#/approval/console
If no value is passed to the debug parameter, all the logging levels are enabled.