# log

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: log
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: processors/log
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/log.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/log.adoc
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/connect/components/processors/log.md -->

**Available in:** [Cloud](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/%20%22View%20the%20Cloud%20version%20of%20this%20component%22), Self-Managed

Prints a log event for each message. Messages always remain unchanged. The log message can be set using function interpolations described in [Bloblang queries](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries) which allows you to log the contents and metadata of messages.

```yml
# Config fields, showing default values
label: ""
log:
  level: INFO
  fields_mapping: |- # No default (optional)
    root.reason = "cus I wana"
    root.id = this.id
    root.age = this.user.age.number()
    root.kafka_topic = meta("kafka_topic")
  message: ""
```

The `level` field determines the log level of the printed events and can be any of the following values: TRACE, DEBUG, INFO, WARN, ERROR.

## [](#structured-fields)Structured fields

It’s also possible add custom fields to logs when the format is set to a structured form such as `json` or `logfmt` with the config field [`fields_mapping`](#fields_mapping):

```yaml
pipeline:
  processors:
    - log:
        level: DEBUG
        message: hello world
        fields_mapping: |
          root.reason = "cus I wana"
          root.id = this.id
          root.age = this.user.age
          root.kafka_topic = meta("kafka_topic")
```

## [](#fields)Fields

### [](#fields_mapping)`fields_mapping`

An optional [Bloblang mapping](https://docs.redpanda.com/connect/guides/bloblang/about/) that can be used to specify extra fields to add to the log. If log fields are also added with the `fields` field then those values will override matching keys from this mapping.

**Type**: `string`

```yaml
# Examples:
fields_mapping: |-
  root.reason = "cus I wana"
  root.id = this.id
  root.age = this.user.age.number()
  root.kafka_topic = meta("kafka_topic")
```

### [](#level)`level`

The log level to use.

**Type**: `string`

**Default**: `INFO`

**Options**: `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`

### [](#message)`message`

The message to print. This field supports [interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries).

**Type**: `string`

**Default**: `""`