[
https://issues.apache.org/jira/browse/CAMEL-13334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16794518#comment-16794518
]
Robert Half commented on CAMEL-13334:
-------------------------------------
The documentation (below for reference) states, that log component is for
logging the exchange: that's what I need for tracing. Also I think it's a
general requirement for a log line, that it contains some info about what is
being logged. Putting log EIP before every log component is not an option: ugly
and in multithreaded environment the log lines won't be in same sequence.
Difference between log in the DSL and [Log] component
The log DSL is much lighter and meant for logging human logs such as Starting
to do ... etc. It can only log a message based on the Simple language. On the
other hand Log component is a full fledged component which involves using
endpoints and etc. The Log component is meant for logging the Message itself
and you have many URI options to control what you would like to be logged.
> Message parameter for log component
> -----------------------------------
>
> Key: CAMEL-13334
> URL: https://issues.apache.org/jira/browse/CAMEL-13334
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.21.5
> Reporter: Robert Half
> Priority: Minor
>
> There does not seem to be a good way to log a message describing what is
> logged.
> Imagine I have a route, where I want to be able to trace all the content. I
> could use .log() processor but log component is better for tracing all the
> exchange details and also provides showStreams option.
>
> {code:java}
> from(direct:in)
> .to(log:MyTestClass?level=TRACE)
> .to(direct:step1)
> .to(log:MyTestClass?level=TRACE)
> .to(direct:step2)
> .to(log:MyTestClass?level=TRACE)
> .to(direct:step3)
> .to(log:MyTestClass?level=TRACE)
> .to(mock:result)
> {code}
>
> In the resulting log, it will be hard to see which line is produced by which
> log producer.
> Something like
> {code:java}
> .to(log:MyTestClass?level=TRACE&message=user before step1){code}
> would be quite helpful. Wondering why it has not been implemented yet. I
> found only early requests from 2008.
> Beeing able to use simple language would be even better:
> {code:java}
> .to(log:MyTestClass?level=TRACE&message=user before step1 -
> ${header.user.name}){code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)