GitHub user dsanderbi closed a discussion: How to access the log level?

Hello community,

does anyone know how i can access the log level?
I tried it via a seperate mapping pipeline using a UDJC transform, see:

```java
import org.apache.hop.core.logging.DefaultLogLevel;
import org.apache.hop.core.logging.LogLevel;

public boolean processRow() throws HopException {

    Object[] r = getRow();
    if (r == null) {
        setOutputDone();
        return false;
    }
        
    LogLevel currentLevel = DefaultLogLevel.getLogLevel();
    String levelCode = currentLevel.getCode();

    if (first) {
        first = false;
    }

    Object[] outputRow = createOutputRow(r, data.outputRowMeta.size());

    // set stream field
    get(Fields.Out, "etl_log_level").setValue(outputRow, levelCode);

    putRow(data.outputRowMeta, outputRow);
    return true;
}
```
When i start the pipeline and reference the mapping, the log level is correct.
Starting in Minimal the log level is set to Minimal.
<img width="804" height="481" alt="{1874D4C4-261B-4F58-95D2-799271013DAD}" 
src="https://github.com/user-attachments/assets/2a4fd864-6ef2-415b-9440-5e83dc74defe";
 />

Starting in Basic the log level is set to Basic, etc.
<img width="868" height="491" alt="{730E7CB9-2D55-46CC-AE7A-6B3CB4AEC839}" 
src="https://github.com/user-attachments/assets/58d75b04-f4ba-420c-9dea-c9e3bd1d7e11";
 />


But as soon as a workflow calls the pipeline, the pipeline uses its default log 
level.

So if the Workflow is started in Minimal but the Pipeline has been set to 
Basic, i see Basic in the output.
<img width="537" height="296" alt="{20BF4541-EE31-49D6-9067-DAC845B23205}" 
src="https://github.com/user-attachments/assets/a347bb60-3491-47d5-9492-4d9b7ae712ec";
 />

Any ideas how i can get the right log level or should i create a feature 
request for a new variable like `HOP_LOG_LEVEL`?

[log-level.zip](https://github.com/user-attachments/files/24408163/log-level.zip)







GitHub link: https://github.com/apache/hop/discussions/6290

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to