BI-Server‎ > ‎

How To Trace SQL Generated by Mondrian


There is a weird analysis look in your Mondrian's Pivot table and you suspect that there may be something wrong in your Schema but where ? 

One and maybe the best way to trace it is to look at the detail of SQL queries generated by Mondrian / Pentaho Analysis. So here's how to do it.


  • Edit file [BI-SERVER FOLDER]/tomcat/webapps/pentaho/WEB-INF/classes/log4j.xml
  • Remove any remark / comment surrounding SQLLOG appender. You can find it near the end of log4.xml file.

  • Done

Trace SQL generated from Pentaho Log File 

  • Restart your BI Server
  • Try to open one of your BI solution that will trigger an MDX execution. For example a pivot view .XAction

  • Open [BI-SERVER]\tomcat\bin\pentaho.log file. You can now see SQL generated by executing a related MDX query.

  • Done