Reputation: 47
I'm wondering if there is a way to debug the sql command that SQL Query component executes at runtime? I know placing a "console.log()" can debug components but SQL Query does not have an event to set the console up
Regards, Erick
Upvotes: 1
Views: 1739
Reputation: 12000
I found this question solving similar problem in Pentaho Data Integration (I wanted to log some information about db connection). In my case I simply created transformation with flow from Table input
element to Write to log
element.
The Table input
element contains, for instance:
select user, sys_context('userenv','db_name') as db_name from dual
And Write to log
"understands" incoming flow and writes to log something like:
2024/05/10 04:04:02 - Write to log.0 - ------------> Linenr 1------------------------------
2024/05/10 04:04:02 - Write to log.0 - USER = YOUR_USER
2024/05/10 04:04:02 - Write to log.0 - DB_NAME = YOUR_DB
Upvotes: 0
Reputation: 419
Shutdown Pentaho Server, goto YOURDRIVE:\pentaho\biserver-ce\tomcat\webapps\pentaho\WEB-INF\classes\
Open log4j.xml and uncomment this section:
<!--
<appender name="SQLLOG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="../logs/mondrian_sql.log"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="500KB"/>
<param name="MaxBackupIndex" value="1"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
</layout>
</appender>
<category name="mondrian.sql">
<priority value="DEBUG"/>
<appender-ref ref="SQLLOG"/>
</category>
-->
GOTO YOURDRIVE:\pentaho\biserver-ce\pentaho-solutions\system\mondrian , open mondrian.properties, make sure below code is set to "true"
mondrian.rolap.generate.formatted.sql=true
Start the Pentaho server now, it will start making mysql log file in the "YOURDRIVE:\pentaho\biserver-ce\tomcat\logs\" folder when you execute the sql statements...
Upvotes: 1