Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Logging in Transformation Steps

A step interacts with the PDI logging system by using the logging methods inherited from BaseStep

These methods are used to issue log lines to the PDI logging system on different severity levels. Multi-argument versions of the methods are available to do some basic formatting, which is equivalent to a call to MessageFormat.format(message, arguments).

  • public void logMinimal()
  • public void logBasic()
  • public void logDetailed()
  • public void logDebug()
  • public void logRowlevel()
  • public void logError()

These methods query the logging level. They are often used to guard sections of code, that should only be executed with elevated logging settings.

  • public boolean isBasic()
  • public boolean isDetailed()
  • public boolean isDebug()
  • public boolean isRowLevel()

Steps should log this information at specified levels.

Log Level Log Information Content
Minimal Only information that is interesting at very high-levels, for example Transformation Started or Ended; individual steps do not log anything at this level
Basic Information that may be interesting to you during regular ETL operation
Detailed Prepared SQL or other query statements, resource allocation and initialization like opening files or connections
Debug Anything that may be useful in debugging step operations
RowLevel Anything that may be helpful in debugging problems at the level of individual rows and values
Error Fatal errors that abort the transformation

Feedback Logging

A transformation defines a feedback size in its settings. The feedback size defines the number of rows after which each step logs a line reporting its progress. This is implemented by calling checkFeedback() with an appropriate row counter as argument to determine if feedback should be logged. Feedback logging happens on the basic log-level. There are many ways you can implement this. Here is an example implementation snippet.

if (checkFeedback(getLinesWritten())) {
  if(isBasic()) logBasic("linenr "+getLinesWritten());

It may make sense to use different row counters for checking the feedback size depending on the implementation logic of your step. For example, a step that accumulates incoming rows into one single summary row, should probably use the linesRead counter to determine the feedback interval.

The Excel Output step has a good example implementation of feedback logging.