ECF Logs
Log Levels
You can set the log level from the host application with the following line:
jQuery.sap.log.setLevel(jQuery.sap.log.Level.DEBUG);
Other possible log levels are (in ascending order, TRACE containing the highest level of information):
-
jQuery.sap.log.Level.FATAL
-
jQuery.sap.log.Level.ERROR
-
jQuery.sap.log.Level.WARNING
-
jQuery.sap.log.Level.INFO
-
jQuery.sap.log.Level.DEBUG
-
jQuery.sap.log.Level.TRACE
To set the log level of the browser to debug, add the following to the URL
?sap-ui-debug=true
This also loads the debug versions of the source files.
Saving Log Files
Log is not written to a file by default. Instead it is collected to the internal log model. The current log information can be saved to a file by requesting it from the host application.
The following code creates a button which saves the current ECF log to a file when clicked. The log file name is logfile.json, and it is saved to the default download folder in the json format.
var loadLogsButton = new sap.m.Button({text: "Download Logs"});
loadLogsButton.attachPress(
function (){
var ecfsession = sap.ecf.core.Session.getInstance();
ecfsession.downloadECFLog();
}
);