Chapter 52. Log Sink


A sink that logs all data that it receives, useful for debugging purposes.

52.1. Configuration Options

The following table summarizes the configuration options available for the log-sink Kamelet:

Expand
PropertyNameDescriptionTypeDefaultExample

loggerName

Logger Name

Name of the logging category to use

string

log-sink

 

level

Log Level

Logging level to use

string

INFO

 

logMask

Log Mask

Mask sensitive information like password or passphrase in the log

boolean

False

 

marker

Marker

An optional Marker name to use

string

  

multiline

Multiline

If enabled then each information is outputted on a newline

boolean

False

 

showAllProperties

Show All Properties

Show all of the exchange properties (both internal and custom)

boolean

False

 

showBody

Show Body

Show the message body

boolean

True

 

showBodyType

Show Body Type

Show the body Java type

boolean

True

 

showExchangePattern

Show Exchange Pattern

Shows the Message Exchange Pattern (or MEP for short)

boolean

True

 

showHeaders

Show Headers

Show the headers received

boolean

False

 

showProperties

Show Properties

Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties.

boolean

False

 

showStreams

Show Streams

Show the stream bodies (they may not be available in following steps)

boolean

False

 

showCachedStreams

Show Cached Streams

Whether Camel should show cached stream bodies or not.

boolean

True

 

* = Fields marked with an asterisk are mandatory.

52.2. Dependencies

52.2.1. Quarkus dependencies

<dependencies>
  <dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifact>camel-quarkus-kamelet</artifact>
  </dependency>
  <dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifact>camel-quarkus-log</artifact>
  </dependency>
  <dependency>
    <groupId>org.apache.camel.kamelets</groupId>
    <artifact>camel-kamelets-utils</artifact>
    <version>4.8.5</version>
  </dependency>
</dependencies>
Copy to Clipboard Toggle word wrap

52.3. Usage

52.3.1. Camel JBang usage

52.3.1.1. Prerequisites for JBang

  • Install JBang.
  • You have executed the following command:

    jbang app install camel@apache/camel
    Copy to Clipboard Toggle word wrap

52.3.1.2. Running a route with JBang

Suppose you have a file named route.yaml with this content:

- route:
    from:
      uri: "kamelet:timer-source"
      parameters:
        period: 10000
        message: 'test'
      steps:
        - to:
            uri: "kamelet:log-sink"
Copy to Clipboard Toggle word wrap

You can now run it directly through the following command.

camel run route.yaml
Copy to Clipboard Toggle word wrap

52.3.2. Knative Sink

You can use the log-sink Kamelet as a Knative sink by binding it to a Knative object.

log-sink-binding.yaml

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: log-sink-binding
spec:
  source:
    ref:
      kind: Channel
      apiVersion: messaging.knative.dev/v1
      name: mychannel
  sink:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: log-sink
Copy to Clipboard Toggle word wrap

52.3.3. Kafka Sink

You can use the log-sink Kamelet as a Kafka sink by binding it to a Kafka topic.

log-sink-binding.yaml

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: log-sink-binding
spec:
  source:
    ref:
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic
  sink:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: log-sink
Copy to Clipboard Toggle word wrap

52.4. Kamelets source file

https://github.com/jboss-fuse/camel-kamelets/blob/camel-kamelets-4.10.3-branch/kamelets/log-sink.kamelet.yaml

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top