Setting LOGLEVEL from Answers

Normally, we check query in NQQuery.log file or from Answers also we can check the query directly.
 Difference is: NQQuery.log contains all the queries and need to identify them by time the report run.
If it’s directly from Answers (go to Settings > Administration > Manage Sessions), log available for every report runs until the query is changed.
 For every query of report there will be created one cursor, by accessing the cursor you can see the physical query generated by BI server.
 If we are unable to see the log file or if we find any error message saying that, No Log found while trying to watch the query in log the first step in the mind is to check the LOGLEVEL. When creating rpd by default, loglevel takes 0 values for Administrator user.
If it’s set to 0, we go for 2 or 3 accordingly, such that, the query will be appeared.
For suppose, if you are accessing presentation service of another system and unable to see the query. You need not to set the LOGLEVEL=2 in the rpd presented in another system.
I am assuming that all cursors are closed and LOGLEVEL is zero for particular user.
Log into answers with user who has LOGLEVEL =0, run any report then go to Settings > Administration > Manage Sessions. Click on View Log option.
You will have error message or you may open the view log but you can’t find the query run at this moment because of loglevel – “0″. (To test this error message, you better delete the content of NQQuery.log completely but before doing this you need to stop your BI Server service then clear the content and save file again start BI Server service)
error-message
Close the window as well as cursors
 Just go to advanced tab of particular report.
advanced-tab
Scroll down to see the option: Prefix
Here write SET VARIABLE LOGLEVEL=2; (semi-colon at the end is must)
 prefix
Now click on Results tab to re – run the report.
 Now you go Settings > Administration > Manage Sessions
Click on View Log to view the query. Now you are able to see the query and according to the LOGLEVEL – 2
 Go back to Advanced tab, observe the Logical query.
Before SQL, you find the text you written in Prefix field.
By mentioning the semi colon, BI Server executes these statements one after another.
This post explain you, how to set loglevel from answers it self, with out going to rpd,
This process overrides the loglevel set in the rpd.