0

I built a PDI (Pentaho Data Integration) transformation and I want to change the logic of the process according to the Logging level of it's execution, e.g.:

If the LogLevel is BASIC, MINIMAL or lower, the transformation should execute regularly, however if the LogLevel is DEBUG, additional parts of the transformation (such as certain writes to log, or record dumps to flat files) should execute in addition to the normal workflow.

Is it possible to access the LogLevel of the job while it's running?

I have tried to find the LogLevel inside internal variables such as Internal.* or KETTLE_*, but to no avail.

Rownum Highart
  • 187
  • 1
  • 13

2 Answers2

0

You can set a global variable, say KETTLE_DEBUG, and have your job choose one version of the ktr or the other depending on its value.

I don’t advise having that logic inside a transformation, as it will be awkward: you’d need to filter rows based on the variable value, but those steps would run always, adding a bit of overhead checking for each row what is effectively a constant.

nsousa
  • 4,448
  • 1
  • 10
  • 15
0

Write to log has the option to set the debug level, so you can determine when it should trigger. I don't believe other steps have this function.

enter image description here

You can achieve the same in a java step as done here: http://www.java2s.com/example/java-src/pkg/org/pentaho/di/ui/trans/step/basestepdialog-b6082.html

Bert-Jan Stroop
  • 357
  • 1
  • 10