on 09-09-2014 5:33 AM
Hi!
I'm doing some experiments with server side javascript tracing on Hana. I created a small xsjs file that searches for some parameters on the web request (first name, last name and email) so I can call a DB procedure later. As I wanted to make sure that client data was arriving to the server properly, I added some trace calls using $.trace as you can see in the snipped below.
After some time I noticed that just $.trace.error calls were added to xsengine*trc trace files. In other words, information, debug and warnings were not being included on the trace files.
$.trace.info("INFO: Register_user.xsjs called");
$.trace.error("ERROR: Register_user.xsjs called");
if($.request.method === $.net.http.POST || $.request.method === $.net.http.GET) {
var first_name = $.request.parameters.get("first_name");
var last_name = $.request.parameters.get("last_name");
var email = $.request.parameters.get("email");
$.trace.error("ERROR: First Name:" + first_name);
$.trace.error("ERROR: Last Name:" + last_name);
$.trace.error("ERROR: Email:" + email);
$.trace.warning("WARNING: First Name:" + first_name);
$.trace.warning("WARNING: Last Name:" + last_name);
$.trace.warning("WARNING: Email:" + email);
// send response
$.response.contentType = "application/json";
$.response.status = $.net.http.OK;
$.response.setBody(" { \"message\" : \"User registered successfully\"} ");
} else {
// unsupported method
$.trace.error("ERROR: Method was not POST");
$.response.status = $.net.http.INTERNAL_SERVER_ERROR;
}
A small piece of a xsengine*.trc file is shown below.
[4940]{-1}[-1/-1] 2014-09-08 20:37:10.453384 e xsa: demo.user_c register_user.xsjs(00026) : ERROR: Register_user.xsjs called
[4940]{-1}[-1/-1] 2014-09-08 20:37:10.453690 e xsa: demo.user_c register_user.xsjs(00037) : ERROR: First Name:war
[4940]{-1}[-1/-1] 2014-09-08 20:37:10.453710 e xsa: demo.user_c register_user.xsjs(00038) : ERROR: Last Name:ning
[4940]{-1}[-1/-1] 2014-09-08 20:37:10.453796 e xsa: demo.user_c register_user.xsjs(00039) : ERROR: Email:warning@gmail.com
[4940]{-1}[-1/-1] 2014-09-08 20:58:21.854254 e xsa: demo.user_c register_user.xsjs(00024) : ERROR: request path: /demo/user_creation/logic/register_user.xsjs
[4940]{-1}[-1/-1] 2014-09-08 20:58:21.854285 e xsa: demo.user_c register_user.xsjs(00026) : ERROR: Register_user.xsjs called
Here are my doubts:
Related (and useful) links which couldn't solve the problem:
I'm using:
Thanks for the support!
Hi Fabio,
You need to do some configurations. Please have a look at Trace Server-Side JavaScript Applications - SAP HANA Developer Guide - SAP Library and View XS JavaScript Application Trace Files - SAP HANA Developer Guide - SAP Library
Best regards,
Wenjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.