Tuesday, January 12, 2010

BI Publisher Logging & Debugging - Part 4

There are more topics I would like to talk about on the BI Publisher logging & debugging. Especially there is now a new feature that allows you to enable the 'Report Generation Logging’ option at each report template level. So instead of enabling the logging feature at the server level you can quickly and easily enable the logging feature only for the report you are working without asking for your system administrator’s help!

Also, sometimes you might wonder what exactly the property values are coming to the RTF template. So I also will talk about this in this post. So let’s start with the ‘Report Level Logging Feature’!

Report Generation Logging Option at Report Level

This is a new feature that has been introduced recently with either October or November patch set release. This gives you an option to set if you want to enable the logging and what level of information at the report template level.

I have talked about how to enable the reports generation logging before and that is a setting at the BI Publisher server level. So if you have enabled the feature then all the reports start generating the log when they run.

While enabling the logging feature at the server level is useful when you want to debug all the reports at a testing environment, it might not be ideal when you want to debug only a particular report without impacting other reports’ performance. In order to turn on or off the logging feature at the server level you need to restart the server, which again might not be ideal when you need to find and ask the system administrator and wait for the next restarting schedule.

With this report level setting you can simply enable the report logging feature only for the reports you’re interested in and no need to wait for the server restart. 

How to Set the Logging at Report Level?

You can simply add a BI Publisher command called ‘xdo-debug-level’ in your RTF template. Here is an example.

<?xdo-debug-level: debug_level?>

The ‘debug-level’ should be replaced by one of the following options.

  • STATEMENT - This log write all the reporting running process information.
  • PROCEDURE - This will log only the procedure level information. This is required to measure the time consumed per each process.
  • ERROR - This will log only the error related information.
  • OFF - This will not log any information.

Example:


<?xdo-debug-level:"STATEMENT"?>

The debug_level value is not case sensitive so it can be either upper or lower case. For example, <?xdo-debug-level:"STATEMENT"?> or <?xdo-debug-level:"statement"?>.

The debug log directory will be generated in one of the following locations:

  • <system-temp-dir>/xdodebug
  • <java.io.tmpdir>/xdodebug (if system-temp-dir is not defined

Again, this setting can be done at the template level, this mean you can either modify the existing RTF template by adding the above command or create a new template which contains only the above command if you’re interested only in debugging the data model or parameter values generation part.

How about XSL Template?

If you are using the XSL Template instead, then you can add ‘<!--xdo-debug-level="statement"-->’ in the first 500 character of the template file.

How to See What Property Values are Passed in RTF Template?

Sometimes you wonder what exactly the values are passed to your RTF template. For example, when you set a custom variable at the server level and try to get the value to do a further operation in the template, it might work or not work the way you wanted. And you want to see if the value is really set and being passed to your template.

There is a very useful command to address this concern. You can simply type the following command in your template.


<?xdoxslt:getXDOProperties($_XDOCTX)?>

And you can upload the template and run from the BI Publisher Server UI. You should get something like below in your report output. 


xslt.CURRENT_SERVER_SCHEME='http'
html-image-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
fo-external-link-target=_blank
html-css-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
system-temp-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
xslt.XDO_USER_ROLES='XMLP_TEMPLATE_DESIGNER,XMLP_ANALYZER_EXCEL,XMLP_ADMIN,XMLP_ANALYZER_ONLINE,XMLP_DEVELOPER,XMLP_SCHEDULER'
xslt.CURRENT_SERVER_PORT='9704'
xdk-secure-io-mode=true
xslt.CURRENT_SERVER_URL='http://knishida-lap.us.oracle.com:9704/bip/'
fo-external-link-base-url='http://knishida-lap.us.oracle.com:9704/bip/POC/'
xslt.XDO_USER_NAME='administrator'
xslt.HOSTPORTPATH='xdo.us.oracle.com/temp'
xslt._XDOCHARTTYPE='image/png'
xslt.CURRENT_SERVER_CONTEXT_PATH='bip'
xslt._XDOOUTPUTFORMAT='text/html'
xslt.HTTPSERVER='knishida-us.oracle.com:9704'
html-css-base-uri=http://knishida-lap.us.oracle.com:9704/bip/xdo/tmp
xslt._FURL='http://knishida-lap.us.oracle.com:9704/bip/POC/'
xslt._xdo_user='administrator'
xslt._xt='New Template 1'
xslt._XDOHTTPSERVER='knishida-us.oracle.com:9704'
html-image-base-uri=http://knishida-lap.us.oracle.com:9704/bip/xdo/tmp/
xslt.CURRENT_SERVER_NAME='knishida-lap.us.oracle.com'
xslt._xf='html'
xslt._XDOLOCALE='en-US'
xdodebug.LogDir=C:\OracleBI\oc4j_bi\debug


All the above variables are available for you to use in your RTF template. And you can see the values if they are the ones you were expecting or not.

7 comments:

  1. Does getXDOProperties only work in BIP-Enterprise? Just tried it in EBS (XMLP 5.6.3) and received the exception:

    Extension function error: Method not found 'getXDOProperties'

    ReplyDelete
  2. Yes, this should be only for BIP Enterprise Server.

    ReplyDelete
  3. Actually this is supported even for EBS, just confirmed with the product development.

    ReplyDelete
  4. How to I use those variables that I see with in my RTF template? The only one that seems to work is _XDOLOCALE, other variables are telling me that "Variable not defined". In example I would like to use the CURRENT_SERVER_URL. Is that possible?

    ReplyDelete
  5. Evelyn,

    For CURRENT_SERVER_URL you need to declare it first. Take a look at this post for the detail. http://bipconsulting.blogspot.com/2010/02/drill-down-to-detail-or-another-report.html

    ReplyDelete
  6. Hi, where do I need to write this statement?
    at which part of template?

    ReplyDelete
  7. When the report is scheduled then not all the parameters show up. For example CURRENT_SERVER_URL does not show up.

    ReplyDelete