# Logging

{% hint style="warning" %}

#### Workshop - Logging

Use logging to diagnose transformation problems. Create a controlled type mismatch error. Use log level and output to find the cause.

**What you’ll do**

* Change field metadata to trigger an error
* Run with **Basic** and **Row level** logging
* Use **Execution results** to find the failing step
* Locate the same error in `pdi.log`

**Prerequisites:** Complete the **Hello World** workshop

**Estimated time:** 5 minutes
{% endhint %}

{% embed url="<https://www.loom.com/share/868c1e73bdeb464e9ef5c2dd3c220d61?hideEmbedTopBar=true&hide_owner=true&hide_share=true&hide_title=true>" %}
Logging
{% endembed %}

***

{% hint style="info" %}
**Create a new transformation**

Use any of these options to open a new transformation tab:

* Select **File** > **New** > **Transformation**
* Use `Ctrl+N` (Windows/Linux) or `Cmd+N` (macOS)
  {% endhint %}

<figure><img src="/files/loS5a4lF51rXARcNKI8Z" alt="" width="375"><figcaption><p>Logging</p></figcaption></figure>

{% file src="/files/mkALCJT1B7bbbTJUrbOb" %}

{% tabs %}
{% tab title="1. Modify Generate Rows" %}
{% hint style="info" %}
Start from the transformation you built in **Hello World**.
{% endhint %}

{% hint style="info" %}

#### **Generate Rows**

Generate Rows is a test-data step. It is a quick way to validate logging and error handling.
{% endhint %}

{% hint style="warning" %}
To create an error, change the field type for `message` from **String** to **Integer**.
{% endhint %}

1. Double-click the **Generate Rows** step.
2. Change the type for `message` to **Integer**.

<div align="center"><figure><img src="/files/Za4qHHAeBcKbC0di993V" alt="" width="375"><figcaption><p>Change data type</p></figcaption></figure></div>

3. Select **OK**.
   {% endtab %}

{% tab title="2. Run" %}
{% hint style="info" %}

#### Run the transformation

Run with a higher log level to see row-level detail.
{% endhint %}

1. Select **Run** in the canvas toolbar.
2. Set **Log level** to **Basic**.
3. Select **Run**.
4. Run again with **Log level** set to **Row level**.

<div align="center"><figure><img src="/files/WdjoimzUF2XWYEo4UPwu" alt="" width="563"><figcaption><p>Set row level debugging</p></figcaption></figure></div>

5. Select **Run**. The failing step is highlighted.

<figure><img src="/files/LDApRREPhxV1kUh5ZkZ7" alt="" width="375"><figcaption><p>Error in step</p></figcaption></figure>

6. In **Execution results**, open the **Log** tab.

<figure><img src="/files/Vm6XnlJlsWboa4ioPCIZ" alt=""><figcaption><p>Logging - error</p></figcaption></figure>

The error text is in the log output. Look for the first **ERROR** entry.

{% hint style="info" %}
Tip: Select the minus icon to show errors only.

The same error is written to `pdi.log`:

{% tabs %}
{% tab title="Windows" %}
`C:\\Pentaho\\design-tools\\data-integration\\logs\\pdi.log`
{% endtab %}

{% tab title="macOS / Linux" %}
`~/Pentaho/design-tools/data-integration/logs/pdi.log`
{% endtab %}
{% endtabs %}
{% endhint %}

<figure><img src="/files/EOgcXcFs3DF8LMUO1GFs" alt=""><figcaption><p>pdi.log - Linux</p></figcaption></figure>
{% endtab %}
{% endtabs %}

***

Next workshop: [Error Handling](/pentaho-data-integration/data-integration/concepts-and-terminology/error-handling.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.pentaho.com/pentaho-data-integration/data-integration/concepts-and-terminology/logging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
