You can't.

But I will commit a small change so you can do:


Tracer tracer = new Tracer();
tracer.getFormatter().setShowHeaders(false);
tracer.getFormatter().setShowNode(false);

getContext().addInterceptStrategy(tracer)


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: cmoulliard [mailto:[EMAIL PROTECTED] 
Sent: 11. juli 2008 10:57
To: [email protected]
Subject: RE: Is it possible to log headers/properties (key,value pairs) through 
interceptors ?


Claus

A) Everyhing that I want is in the trace generated ;)

B) It should be interesting to have a MULTI_LINE_STYLE for the tracing for
the readability of the output. The line is sometimes very very long.

C) How can I activate/deactivate one of the flavor available 

Option   Default         Description
showBreadCrumb  true    Outputs the unique unit of work for the exchange. To
be used for correlation so you can identify the same exchange.
showNode        true    The destination node.
showExchangeId  false   To output the unique exchange id. Currently the
breadcrumb is sufficient.
showProperties  true    Output the exchange properties
showHeaders     true    Output the in message headers
showBodyType    true    Output the in body Java type
showBody        true    Output the in body 

through the method :  getContext().addInterceptStrategy(new Tracer()) ?

Regards,

charles



Claus Ibsen wrote:
> 
> Ad 1)
> The tracer already displayes the headers and propeties etc. See the sample
> at: http://activemq.apache.org/camel/tracer.html
> 
> But we could also improve the existing logger to have a verbose option to
> log some more. But try the tracer to see if it's covering your needs.
> 
> Ad 2)
> That is a path I don't think we should go. The JMX console holds very
> little state (= the performance metrics). If it should also contains a
> list of all the exchanges that has been pass through it then it would
> require massive memory over time. The tracer should be sufficient for now.
> 
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: cmoulliard [mailto:[EMAIL PROTECTED] 
> Sent: 11. juli 2008 09:24
> To: [email protected]
> Subject: RE: Is it possible to log headers/properties (key,value pairs)
> through interceptors ?
> 
> 
> That's the idea in order to easily display on the console the content of
> the
> message including body/headers/properties and so on. I think that we
> should
> separate the information related to the infrastructure like
> endpoints/routes/process and so on from the business logic that we
> implement
> in to the messages. The logging available is enough using
> ("log:myLogOutput?level=INFO,WARN,DEBUG") or the JMX console (except that
> it
> is not possbile through the console to see the content of the body +
> headers
> + properties and son).
> 
> So, two possibilities exist and can be combine together :
> 
> 1) Extent the existing tracing option (enable.Trace()) to displau to
> console
> not only the message but also body/headers/properties info
> 
> 2) Adapt jmx console to consult the content of the messages
> 
> Remark : I'm not sure that we must implement addtional code to allow a
> user
> to customising the logging in order to add new logging features.
> 
> Regards,
> 
> Charles
> 
> Claus Ibsen wrote:
>> 
>> Camel uses the ExchangeFormatter to format a string that is logged with
>> the log component. The default implementation does a toString() on the
>> Exchange object. And the default implementation logs the in message, that
>> outputs its body.
>> 
>> So you want a verbose mode that outputs more or less the entire exchange?
>> - in body
>> - out body
>> - exchange pattern
>> - exchange id
>> - in headers
>> - out headers
>> - exchange properties
>> - etc.
>> 
>> Well that is doable. Even though the functionally is there already with
>> the trace interceptor.
>> 
>> But we could extend the Log component to be able to set your own exchange
>> formatter object and then you can implement the code that outputs the
>> string message. And/Or we could add more options to the log component so
>> you can turn on/off individual log outputs.
>> 
>> Any thoughts? 
>> 
>> 
>> 
>> 
>> Med venlig hilsen
>>  
>> Claus Ibsen
>> ......................................
>> Silverbullet
>> Skovsgårdsvænget 21
>> 8362 Hørning
>> Tlf. +45 2962 7576
>> Web: www.silverbullet.dk
>> 
>> -----Original Message-----
>> From: cmoulliard [mailto:[EMAIL PROTECTED] 
>> Sent: 10. juli 2008 14:46
>> To: [email protected]
>> Subject: Is it possible to log headers/properties (key,value pairs)
>> through interceptors ?
>> 
>> 
>> Hi,
>> 
>> I have created a method to display in the console the key/value pairs of
>> my
>> headers / properties when I process a message in a bean because the
>> intercept.to("log:myLog?level=DEBUG").proceed() does not generate
>> anything.
>> 
>> Question : Is something exist in the Camel framework to display key/value
>> pairs of headers/properties through logging/interceptor classes or should
>> we
>> have to developp such display functionality ?
>> 
>> Regards,
>> 
>> Charles
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Is-it-possible-to-log-headers-properties-%28key%2Cvalue-pairs%29-through-interceptors---tp18382140s22882p18382140.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Is-it-possible-to-log-headers-properties-%28key%2Cvalue-pairs%29-through-interceptors---tp18382140s22882p18398223.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : [EMAIL PROTECTED]
web site : www.xpectis.com 
-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-log-headers-properties-%28key%2Cvalue-pairs%29-through-interceptors---tp18382140s22882p18399513.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to