Skip to main content
Pentaho Documentation

PDI logging

Parent article

You can troubleshoot issues without having to examine the comprehensive log of server executions with PDI logging. PDI logging contains transformation and job logs for both PDI client and Pentaho Server executions in a separate log file from the comprehensive logging data.

For information on comprehensive logging, see the Pentaho Logging article.

Set up the log file

Transformation and job logging is not enabled by default, and the PDI client and Pentaho Server must be configured separately. Perform the following steps to enable and configure the logging for the Pentaho Server or PDI client:

Procedure

  1. Stop all relevant servers or exit the PDI client.

  2. Navigate to the following directory and open the log4j.xml file with any text editor:

    Pentaho Serverserver/pentaho-server/tomcat/webapps/pentaho/WEB-INF/classes
    PDI clientdesign-tools/data-integration/classes
  3. Add the following code to the log4j.xml file:

    Pentaho Server
    <appender name="pdi-execution-appender" class="org.apache.log4j.rolling.RollingFileAppender">
        <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
          <param name="ActiveFileName"  value="/Applications/yourserver/server/pentaho-server/logs/pdi.log" />
          <param name="FileNamePattern" value="/Applications/yourserver/server/pentaho-server/logs/pdi.%d{yyyy-MM-dd}.log" />
        </rollingPolicy>
        <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p &lt;%t&gt; %m%n"/>
        </layout>
      </appender>
      
      <logger name="org.pentaho.di.trans.Trans" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="pdi-execution-appender"/>
      </logger>
        <logger name="org.pentaho.di.job.Job" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="pdi-execution-appender"/>
      </logger>
    PDI client
    <appender name="pdi-execution-appender" class="org.apache.log4j.rolling.RollingFileAppender">
           <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
               <param name="ActiveFileName"  value="logs/pdi.log" />
               <param name="FileNamePattern" value="logs/pdi.%d{yyyy-MM-dd}.log" />
           </rollingPolicy>
           <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p &lt;%t&gt; %m%n"/>
           </layout>
       </appender>
  4. Set your desired logging levels in the XML elements you have added. You can set different logging levels for transformations than for jobs. The following table maps PDI logging levels to the corresponding Apache Log4j levels:

    PDI Log LevelLog4j Log Level
    BASICINFO
    DETAILEDINFO
    MINIMALWARN
    DEBUGDEBUG
    ERRORERROR
    ROWLEVELTRACE
  5. Set your desired log file rotation (rollingPolicy) value by editing the FileNamePattern parameter in the log4j.xml file. The parameters are:

    ParameterDescription
    yyyy-MM-ddSpecify a daily rotation (Default).
    yyyy-MMSpecify a monthly rotation.
    yyyy-MM-dd-HH-mmSpecify a rotation every minute.
  6. Save and close the file, then start all affected servers or the PDI client to test the configuration.

Use the log file

The log files are located in the following directories:
Pentaho Serverserver/pentaho-server/logs/pdi.log
PDI clientdesign-tools/data-integration/logs/pdi.log
Navigate to a log file and open the file to view the contents. The log entry fields in the log files are:
FieldDescription
DateTimeStampDate and time of the log
LogThresholdLogging level (INFO, ERROR, DEBUG, WARN, or TRACE)
ThreadIDUnique key for the job or transformation execution
FilepathAbsolute path of the transformation or job
MessageLog message
The following is an example of a log entry:

2018-03-07 11:40:36.290 INFO <Launch transformation UUID: 1246b616-a845-4cbc-9f4c-8a4a2cbfb4f1> [C:\build\pdi-ee-client-8.1.0.0-267\data-integration\samples\jobs\run_all\Run all sample transformations.kjb file:///C:/build/pdi-ee-client-8.1.0.0-267/data-integration/samples/jobs/run_all/Define FILENAME Variable and execute.kjb] Starting entry

This entry contains these values for the following fields:
FieldDescription
DateTimeStamp2018-03-07 11:40:36.290
LogThresholdINFO
ThreadID<Launch transformation UUID: 1246b616-a845-4cbc-9f4c-8a4a2cbfb4f1>
Filepath[C:\build\pdi-ee-client-8.1.0.0-267\data-integration\samples\jobs\run_all\Run all sample transformations.kjb file:///C:/build/pdi-ee-client-8.1.0...run_all/DefineFILENAME Variable and execute.kjb]
MessageStarting entry