You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "roy.truelove" <ro...@gmail.com> on 2011/08/25 20:27:00 UTC

Tracer Logging never turned on?

Camel 2.9

I wrote a very simple junit test (below) with the tracer turned on, but I
didn't seem to get any tracing messages, so I fired up the debugger.

It looks like when the tracer tries to log, it has have it's log level set. 
Initially this is done by the DefaultDebugger class, which sets it to 'OFF'
(line 334).

I put a break point on the other places where the tracer's 'setLogLevel'
method is called, and it never is.  I'd expect it to be set to 'INFO' when I
call 'context.setTracing(true)'.

Where is the tracer intended to set the log level to INFO?

Thanks,
Roy

public class TracerTest extends CamelTestSupport {

	@Override
	protected RouteBuilder createRouteBuilder() {
		return new RouteBuilder() {

			@Override
			public void configure() throws Exception {
				from("direct:in").to("mock:out");
			}
		};
	}

	@Test
	public void testName() throws Exception {

		context.setTracing(true);
		template.sendBody("direct:in", "Hello!");

		Thread.sleep(1000000);  // so the debug can do it's thing
	}
}

--
View this message in context: http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Tracer Logging never turned on?

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can not simply enable the trace by setting the tracing option.
You need to override the createCamelContext like this.

     @Override
     protected CamelContext createCamelContext() throws Exception {
         CamelContext context = super.createCamelContext();

         tracer = Tracer.createTracer(context);
         tracer.setEnabled(true);
         tracer.setTraceInterceptors(true);
         tracer.setTraceFilter(body().contains("Camel"));
         tracer.setTraceExceptions(true);
         tracer.setLogStackTrace(true);
         tracer.setUseJpa(false);
         tracer.setDestination(context.getEndpoint("mock:traced"));

         context.addInterceptStrategy(tracer);
         tracer.start();

         return context;
     }
You can find more information about tracer here[1]
[1]http://camel.apache.org/tracer.html

On 8/26/11 2:27 AM, roy.truelove wrote:
> Camel 2.9
>
> I wrote a very simple junit test (below) with the tracer turned on, but I
> didn't seem to get any tracing messages, so I fired up the debugger.
>
> It looks like when the tracer tries to log, it has have it's log level set.
> Initially this is done by the DefaultDebugger class, which sets it to 'OFF'
> (line 334).
>
> I put a break point on the other places where the tracer's 'setLogLevel'
> method is called, and it never is.  I'd expect it to be set to 'INFO' when I
> call 'context.setTracing(true)'.
>
> Where is the tracer intended to set the log level to INFO?
>
> Thanks,
> Roy
>
> public class TracerTest extends CamelTestSupport {
>
> 	@Override
> 	protected RouteBuilder createRouteBuilder() {
> 		return new RouteBuilder() {
>
> 			@Override
> 			public void configure() throws Exception {
> 				from("direct:in").to("mock:out");
> 			}
> 		};
> 	}
>
> 	@Test
> 	public void testName() throws Exception {
>
> 		context.setTracing(true);
> 		template.sendBody("direct:in", "Hello!");
>
> 		Thread.sleep(1000000);  // so the debug can do it's thing
> 	}
> }
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: Tracer Logging never turned on?

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Oct 15, 2011 at 9:39 AM, Christian Schneider
<ch...@die-schneider.net> wrote:
> That is fine but we should document it.
>

I added a note to the knowns issues list of the 2.8 release notes.


> Christian
>
> Am 15.10.2011 08:55, schrieb Claus Ibsen:
>>
>> On Fri, Oct 14, 2011 at 11:10 PM, Christian Schneider
>> <ch...@die-schneider.net>  wrote:
>>>
>>> I recently tested with debugger and tracer both active on camel
>>> 2.8.2-SNAPSHOT.
>>> When I activated the debugger the tracer stopped working. So is it
>>> possible
>>> that this is still a problem with 2.8.x?
>>>
>> Yes its most likely only fixed on trunk as the fix was not easy to do,
>> and backporting causes a bigger risk.
>>
>>
>>> Christian
>>>
>>> Am 27.08.2011 08:51, schrieb Claus Ibsen:
>>>>
>>>> Do you mean Camel 2.8 version or do you use the source from the trunk,
>>>> eg 2.9-SNAPSHOT?
>>>>
>>>> There is a fix in the Camel test kit in 2.9-SNAPSHOT so the tracer
>>>> should work fine by logging at INFO level by default.
>>>> There was a conflict with a debugger installed by the test kit, which
>>>> would alter the logging level on the tracer.
>>>>
>>>>
>>>>
>>>> On Thu, Aug 25, 2011 at 8:27 PM, roy.truelove<ro...@gmail.com>
>>>>  wrote:
>>>>>
>>>>> Camel 2.9
>>>>>
>>>>> I wrote a very simple junit test (below) with the tracer turned on, but
>>>>> I
>>>>> didn't seem to get any tracing messages, so I fired up the debugger.
>>>>>
>>>>> It looks like when the tracer tries to log, it has have it's log level
>>>>> set.
>>>>> Initially this is done by the DefaultDebugger class, which sets it to
>>>>> 'OFF'
>>>>> (line 334).
>>>>>
>>>>> I put a break point on the other places where the tracer's
>>>>> 'setLogLevel'
>>>>> method is called, and it never is.  I'd expect it to be set to 'INFO'
>>>>> when I
>>>>> call 'context.setTracing(true)'.
>>>>>
>>>>> Where is the tracer intended to set the log level to INFO?
>>>>>
>>>>> Thanks,
>>>>> Roy
>>>>>
>>>>> public class TracerTest extends CamelTestSupport {
>>>>>
>>>>>        @Override
>>>>>        protected RouteBuilder createRouteBuilder() {
>>>>>                return new RouteBuilder() {
>>>>>
>>>>>                        @Override
>>>>>                        public void configure() throws Exception {
>>>>>                                from("direct:in").to("mock:out");
>>>>>                        }
>>>>>                };
>>>>>        }
>>>>>
>>>>>        @Test
>>>>>        public void testName() throws Exception {
>>>>>
>>>>>                context.setTracing(true);
>>>>>                template.sendBody("direct:in", "Hello!");
>>>>>
>>>>>                Thread.sleep(1000000);  // so the debug can do it's
>>>>> thing
>>>>>        }
>>>>> }
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>
>>>
>>> --
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> Talend Application Integration Division http://www.talend.com
>>>
>>>
>>
>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Tracer Logging never turned on?

Posted by Christian Schneider <ch...@die-schneider.net>.
That is fine but we should document it.

Christian

Am 15.10.2011 08:55, schrieb Claus Ibsen:
> On Fri, Oct 14, 2011 at 11:10 PM, Christian Schneider
> <ch...@die-schneider.net>  wrote:
>> I recently tested with debugger and tracer both active on camel
>> 2.8.2-SNAPSHOT.
>> When I activated the debugger the tracer stopped working. So is it possible
>> that this is still a problem with 2.8.x?
>>
> Yes its most likely only fixed on trunk as the fix was not easy to do,
> and backporting causes a bigger risk.
>
>
>> Christian
>>
>> Am 27.08.2011 08:51, schrieb Claus Ibsen:
>>> Do you mean Camel 2.8 version or do you use the source from the trunk,
>>> eg 2.9-SNAPSHOT?
>>>
>>> There is a fix in the Camel test kit in 2.9-SNAPSHOT so the tracer
>>> should work fine by logging at INFO level by default.
>>> There was a conflict with a debugger installed by the test kit, which
>>> would alter the logging level on the tracer.
>>>
>>>
>>>
>>> On Thu, Aug 25, 2011 at 8:27 PM, roy.truelove<ro...@gmail.com>
>>>   wrote:
>>>> Camel 2.9
>>>>
>>>> I wrote a very simple junit test (below) with the tracer turned on, but I
>>>> didn't seem to get any tracing messages, so I fired up the debugger.
>>>>
>>>> It looks like when the tracer tries to log, it has have it's log level
>>>> set.
>>>> Initially this is done by the DefaultDebugger class, which sets it to
>>>> 'OFF'
>>>> (line 334).
>>>>
>>>> I put a break point on the other places where the tracer's 'setLogLevel'
>>>> method is called, and it never is.  I'd expect it to be set to 'INFO'
>>>> when I
>>>> call 'context.setTracing(true)'.
>>>>
>>>> Where is the tracer intended to set the log level to INFO?
>>>>
>>>> Thanks,
>>>> Roy
>>>>
>>>> public class TracerTest extends CamelTestSupport {
>>>>
>>>>         @Override
>>>>         protected RouteBuilder createRouteBuilder() {
>>>>                 return new RouteBuilder() {
>>>>
>>>>                         @Override
>>>>                         public void configure() throws Exception {
>>>>                                 from("direct:in").to("mock:out");
>>>>                         }
>>>>                 };
>>>>         }
>>>>
>>>>         @Test
>>>>         public void testName() throws Exception {
>>>>
>>>>                 context.setTracing(true);
>>>>                 template.sendBody("direct:in", "Hello!");
>>>>
>>>>                 Thread.sleep(1000000);  // so the debug can do it's thing
>>>>         }
>>>> }
>>>>
>>>> --
>>>> View this message in context:
>>>> http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>
>>
>> --
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>>
>>
>
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Tracer Logging never turned on?

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Oct 14, 2011 at 11:10 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
> I recently tested with debugger and tracer both active on camel
> 2.8.2-SNAPSHOT.
> When I activated the debugger the tracer stopped working. So is it possible
> that this is still a problem with 2.8.x?
>

Yes its most likely only fixed on trunk as the fix was not easy to do,
and backporting causes a bigger risk.


> Christian
>
> Am 27.08.2011 08:51, schrieb Claus Ibsen:
>>
>> Do you mean Camel 2.8 version or do you use the source from the trunk,
>> eg 2.9-SNAPSHOT?
>>
>> There is a fix in the Camel test kit in 2.9-SNAPSHOT so the tracer
>> should work fine by logging at INFO level by default.
>> There was a conflict with a debugger installed by the test kit, which
>> would alter the logging level on the tracer.
>>
>>
>>
>> On Thu, Aug 25, 2011 at 8:27 PM, roy.truelove<ro...@gmail.com>
>>  wrote:
>>>
>>> Camel 2.9
>>>
>>> I wrote a very simple junit test (below) with the tracer turned on, but I
>>> didn't seem to get any tracing messages, so I fired up the debugger.
>>>
>>> It looks like when the tracer tries to log, it has have it's log level
>>> set.
>>> Initially this is done by the DefaultDebugger class, which sets it to
>>> 'OFF'
>>> (line 334).
>>>
>>> I put a break point on the other places where the tracer's 'setLogLevel'
>>> method is called, and it never is.  I'd expect it to be set to 'INFO'
>>> when I
>>> call 'context.setTracing(true)'.
>>>
>>> Where is the tracer intended to set the log level to INFO?
>>>
>>> Thanks,
>>> Roy
>>>
>>> public class TracerTest extends CamelTestSupport {
>>>
>>>        @Override
>>>        protected RouteBuilder createRouteBuilder() {
>>>                return new RouteBuilder() {
>>>
>>>                        @Override
>>>                        public void configure() throws Exception {
>>>                                from("direct:in").to("mock:out");
>>>                        }
>>>                };
>>>        }
>>>
>>>        @Test
>>>        public void testName() throws Exception {
>>>
>>>                context.setTracing(true);
>>>                template.sendBody("direct:in", "Hello!");
>>>
>>>                Thread.sleep(1000000);  // so the debug can do it's thing
>>>        }
>>> }
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Tracer Logging never turned on?

Posted by Christian Schneider <ch...@die-schneider.net>.
I recently tested with debugger and tracer both active on camel 
2.8.2-SNAPSHOT.
When I activated the debugger the tracer stopped working. So is it 
possible that this is still a problem with 2.8.x?

Christian

Am 27.08.2011 08:51, schrieb Claus Ibsen:
> Do you mean Camel 2.8 version or do you use the source from the trunk,
> eg 2.9-SNAPSHOT?
>
> There is a fix in the Camel test kit in 2.9-SNAPSHOT so the tracer
> should work fine by logging at INFO level by default.
> There was a conflict with a debugger installed by the test kit, which
> would alter the logging level on the tracer.
>
>
>
> On Thu, Aug 25, 2011 at 8:27 PM, roy.truelove<ro...@gmail.com>  wrote:
>> Camel 2.9
>>
>> I wrote a very simple junit test (below) with the tracer turned on, but I
>> didn't seem to get any tracing messages, so I fired up the debugger.
>>
>> It looks like when the tracer tries to log, it has have it's log level set.
>> Initially this is done by the DefaultDebugger class, which sets it to 'OFF'
>> (line 334).
>>
>> I put a break point on the other places where the tracer's 'setLogLevel'
>> method is called, and it never is.  I'd expect it to be set to 'INFO' when I
>> call 'context.setTracing(true)'.
>>
>> Where is the tracer intended to set the log level to INFO?
>>
>> Thanks,
>> Roy
>>
>> public class TracerTest extends CamelTestSupport {
>>
>>         @Override
>>         protected RouteBuilder createRouteBuilder() {
>>                 return new RouteBuilder() {
>>
>>                         @Override
>>                         public void configure() throws Exception {
>>                                 from("direct:in").to("mock:out");
>>                         }
>>                 };
>>         }
>>
>>         @Test
>>         public void testName() throws Exception {
>>
>>                 context.setTracing(true);
>>                 template.sendBody("direct:in", "Hello!");
>>
>>                 Thread.sleep(1000000);  // so the debug can do it's thing
>>         }
>> }
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>


-- 
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Tracer Logging never turned on?

Posted by Claus Ibsen <cl...@gmail.com>.
Do you mean Camel 2.8 version or do you use the source from the trunk,
eg 2.9-SNAPSHOT?

There is a fix in the Camel test kit in 2.9-SNAPSHOT so the tracer
should work fine by logging at INFO level by default.
There was a conflict with a debugger installed by the test kit, which
would alter the logging level on the tracer.



On Thu, Aug 25, 2011 at 8:27 PM, roy.truelove <ro...@gmail.com> wrote:
> Camel 2.9
>
> I wrote a very simple junit test (below) with the tracer turned on, but I
> didn't seem to get any tracing messages, so I fired up the debugger.
>
> It looks like when the tracer tries to log, it has have it's log level set.
> Initially this is done by the DefaultDebugger class, which sets it to 'OFF'
> (line 334).
>
> I put a break point on the other places where the tracer's 'setLogLevel'
> method is called, and it never is.  I'd expect it to be set to 'INFO' when I
> call 'context.setTracing(true)'.
>
> Where is the tracer intended to set the log level to INFO?
>
> Thanks,
> Roy
>
> public class TracerTest extends CamelTestSupport {
>
>        @Override
>        protected RouteBuilder createRouteBuilder() {
>                return new RouteBuilder() {
>
>                        @Override
>                        public void configure() throws Exception {
>                                from("direct:in").to("mock:out");
>                        }
>                };
>        }
>
>        @Test
>        public void testName() throws Exception {
>
>                context.setTracing(true);
>                template.sendBody("direct:in", "Hello!");
>
>                Thread.sleep(1000000);  // so the debug can do it's thing
>        }
> }
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Tracer-Logging-never-turned-on-tp4735516p4735516.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/