How do I set the max chars when debug logging messages in Camel

Available as of Camel 2.0

When you run Camel with logging, it will log the messages and its content from time to time.
As some messages can contain very big payloads Camel will by default clip the log message and only show the first 1000 chars.

You will see this in the log as:

Here we have a big message that just contains many numbers. As its based on an unit test we have set a custom limit of 20 chars, and we have a payload with 1000 chars in total.

You can customize the limit when Camel clips the body in the log.
You can use a limit of 0 or negative to disable it so the entire body is shown.

From Camel 2.12 onwards, setting a negative value, such as -1, means the message body is not logged. For earlier Camel versions, you would need to set the value to 1, and have the first char logged.

Customizing from Java DSL

You add to the Camel properties the limit. For example to limit at 500 chars:

Customizing from Spring DSL

You add to the Camel properties the limit. For example to limit at 500 chars:

© 2004-2014 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram