FAQ
I'm trying to log message body using something like:

from ("jms:mytestqueue").
setBody().simple("Say Hello").
.log(LoggingLevel.DEBUG, "Message body: ${body}")
..............................

In my log file, instead of seeing "Message body: Say Hello" I got "Message
body: ${body}", any extra configuration I need to do get the ${body} place
holder work?

Thanks in advance.




--
View this message in context: http://camel.465427.n5.nabble.com/help-with-log-DSL-tp5433969p5433969.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Chris Odom at Jan 26, 2012 at 9:05 pm
    Looks like you have Quotations around the ${body} making it literal, try
    "Message body: "+${body} instead....

    Hope this helps

    On Thu, 26 Jan 2012 13:00:25 -0800 (PST), honghebox wrote:
    I'm trying to log message body using something like:

    from ("jms:mytestqueue").
    setBody().simple("Say Hello").
    .log(LoggingLevel.DEBUG, "Message body: ${body}")
    ..............................

    In my log file, instead of seeing "Message body: Say Hello" I got "Message
    body: ${body}", any extra configuration I need to do get the ${body} place
    holder work?

    Thanks in advance.




    --
    View this message in context:
    http://camel.465427.n5.nabble.com/help-with-log-DSL-tp5433969p5433969.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
    --
    Thanks,
    Chris Odom
    512:799-0270
  • Honghebox at Jan 26, 2012 at 9:09 pm
    No, without quotations around ${body}, you code even won't compile.

    --
    View this message in context: http://camel.465427.n5.nabble.com/help-with-log-DSL-tp5433969p5433989.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Chris Odom at Jan 26, 2012 at 9:43 pm
    Sorry was thinking Spring/Blueprint not Java DSL.

    you cant not really do a .log() in Java DSL you need to use a .to()

    go look at http://camel.apache.org/log.html

    try .to("log:PACKAGE?level=DEBUG&showBody=true")

    where PACKAGE is the java package space for logging. ex:
    log:com.national?...

    --
    Thanks,
    Chris Odom
    512:799-0270
  • Rich Newcomb at Jan 26, 2012 at 9:54 pm
    You can use the .log in your routes, via the log EIP (
    http://camel.apache.org/logeip.html).

    I tested the route segment supplied in the original message (via
    Camel 2.6.0-fuse-01-09) ::

    .setBody().simple("Say Hello")

    .log(LoggingLevel.DEBUG, "Message body: ${body}")

    .. and it works as expected. Original poster -- I think there must be
    some trivial problem with your code -- such as a '(' used instead of a '}'.

    Please copy & paste the code snippet directly from your IDE if you can not
    find the problem.

    On Thu, Jan 26, 2012 at 1:41 PM, Chris Odom wrote:

    Sorry was thinking Spring/Blueprint not Java DSL.

    you cant not really do a .log() in Java DSL you need to use a .to()

    go look at http://camel.apache.org/log.html

    try .to("log:PACKAGE?level=DEBUG&showBody=true")

    where PACKAGE is the java package space for logging. ex:
    log:com.national?...

    --
    Thanks,
    Chris Odom
    512:799-0270

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedJan 26, '12 at 9:00p
activeJan 26, '12 at 9:54p
posts5
users3
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase