28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Required to display the available SQL Connections and the current user mapping<br />

● sap.hana.xs.sqlcc::Administrator<br />

Required to change the user mapping<br />

9.6 Tracing JavaScript<br />

9.6.1 Server-Side JavaScript Tracing<br />

The <strong>SAP</strong> <strong>HANA</strong> XS server-side JavaScript API provides tracing functions that enable your application to write<br />

predefined messages in the form of application-specific trace output in the xsengine trace files (xsengine*.trc)<br />

according to the trace level you specify, for example, “info”(information) or “error”.<br />

If you use the server-side JavaScript API to enable your application to write trace output, you can choose from the<br />

following trace levels:<br />

● debug<br />

● info<br />

● warning<br />

● error<br />

● fatal<br />

For example, to enable debug-level tracing for your JavaScript application:<br />

$.trace.debug("request path: " + $.request.path);<br />

Note: You can view the xsengine*.trace files in the Diagnosis Files tab page in the Administration<br />

perspective of the <strong>SAP</strong> <strong>HANA</strong> studio.<br />

9.6.2 Tracing Server-Side JavaScript Applications<br />

The server-side JavaScript API for <strong>SAP</strong> <strong>HANA</strong> XS enables you to activate the writing of trace messages into an<br />

application-specific trace file; the following trace levels are available: debug, error, fatal, info, and warning.<br />

By default, applications write messages of severity level error to the xsengine*.trc trace files; you can increase<br />

the trace level manually, for example, to fatal. In <strong>SAP</strong> <strong>HANA</strong> XS, the following steps are required to enable trace<br />

output for your server-side JavaScript application:<br />

1. Open the <strong>SAP</strong> <strong>HANA</strong> studio.<br />

2. In the Navigator view, double-click the <strong>SAP</strong> <strong>HANA</strong> instance to open the Administration view for the repository<br />

where your server-side JavaScript source files are located.<br />

3. Choose the Trace Configuration view.<br />

4. In the Global Database Trace screen area, choose Edit Configuration.<br />

The Edit Configuration icon is only visible if you have the required privileges on the selected <strong>SAP</strong> <strong>HANA</strong><br />

system.<br />

5. Select the Show All Components checkbox.<br />

6. Enter the partial or full name of your application into the search box.<br />

7. Expand the GLOBAL node, if necessary, to view registered traces for the application name returned by the<br />

search operation.<br />

224<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved.<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Writing Server-Side JavaScript Applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!