---
title: log
latest-connect-version: 4.118.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.7
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
description: Prints a log event for each message. Messages always remain unchanged. The log message can be set using function interpolations described in Bloblang queries which allows you to log the contents and metadata of messages.
page-cloud-available: "true"
page-cloud-available-url: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/log/
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-10-29"
page-generated-sources:
  - include: connect:components:partial$descriptions/processors/log.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/processors/log.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/processors/log.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

# 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)

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

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.

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

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")
```

### Common

```yml
processor:
  label: ""
  log:
    level: INFO
    fields_mapping: "" # No default (optional)
    message: ""
```

### Advanced

```yml
processor:
  label: ""
  log:
    level: INFO
    fields_mapping: "" # No default (optional)
    message: ""
```

## Fields

### `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`

The log level to use.

**Type**: `string`

**Default**: `INFO`

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

### `message`

The message to print.

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

**Type**: `string`

**Default**: `""`