Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Mondrian configure MDX logging

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Default Mondrian configure MDX logging

    Hi there,

    I'm using mondrian to an academic project. I'm building a dashboard with some widgets that display data provided from a mondrian cube. The dashboard is displayed in a website (using java/jsp, tomcat 7). I'm using the foodmart sample at the moment. Everything is working, but now i need to get the MDX logs from mondrian, to check wich queries were executed and their execution time.

    I've read the documentation about logging (http://mondrian.pentaho.com/document...figuration.php) but i couln't make it work. I've also searched in the web, but all the tutorials i've found were refering to a log4j.xml file, but in my Tomcat7/webapps/mondrian/WEB-INF/classes/ i only have the file log4j.properties.

    I tried to put this in my Tomcat7/webapps/mondrian/WEB-INF/classes/log4j.properties:

    Code:
    # Set root logger level to DEBUG and its only appender to MONDRIAN.
    log4j.rootLogger=WARN, MONDRIAN# MONDRIAN is set to be a ConsoleAppender.log4j.appender.MONDRIAN=org.apache.log4j.ConsoleAppender# MONDRIAN uses PatternLayout.log4j.appender.MONDRIAN.layout=org.apache.log4j.PatternLayoutlog4j.appender.MONDRIAN.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n# Trace MDX and SQL statementslog4j.category.mondrian.mdx=DEBUG, MONDRIAN
    Then i set the CATALINA_OPTS environment variable:
    Code:
    export CATALINA_OPTS="-Xms16m -Xmx256m
    Code:
    -Dlog4j.configuration=file:log4j.properties";
    And then, i restarted mondrian through tomcat server, and ran some mdx queries, but no log files were created. I tried to run mdx query from my website, and from the jpivot sample in mondrian webapp.What am i doing wrong? In the documentation, i didn't understand what this line means:Then mondrian with the argument -Dlog4j.configuration=file:log4j.properties on the Java command line.Can u give me some help?Thanks in advance

  2. #2

    Default

    Hi,

    I cannot access my Mondrian setup myself at the moment so am unable to verify, but I have a backup log4j.properties file here which I believe worked for me (on Tomcat6 though):
    Code:
    log4j.rootLogger=DEBUG, MONDRIAN
    
    # Log to file
    log4j.appender.MONDRIAN=org.apache.log4j.RollingFileAppender
    log4j.appender.MONDRIAN.File=/var/log/tomcat6/_mondrian_debug.log
    
    log4j.category.MONDRIAN.mdx=DEBUG, MONDRIAN
    log4j.category.MONDRIAN.sql=DEBUG, MONDRIAN
    
    log4j.appender.MONDRIAN.layout=org.apache.log4j.PatternLayout
    log4j.appender.MONDRIAN.layout.conversionPattern=%L - %m%n
    Perhaps it also works for you. Good luck.

  3. #3
    Join Date
    Mar 2007
    Posts
    142

    Default

    This is the XML equivalent:


    Code:
    <appender name="MDXLOG" class="org.apache.log4j.RollingFileAppender">
         <param name="File" value="mdx.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.mdx">
          <priority value="DEBUG"/>
          <appender-ref ref="MDXLOG"/>
       </category>
    Luc Boudreau
    aka. Luc le Magnifique
    aka. Monsieur Oui Oui

    Lead Engineer, Pentaho Corporation
    Web: http://devdonkey.blogspot.com
    Twitter: luclemagnifique
    IRC: Monsieur_Oui_Oui@freenode

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.