当前位置: 首页>>代码示例>>Java>>正文


Java Tracer.setFormatter方法代码示例

本文整理汇总了Java中org.apache.camel.processor.interceptor.Tracer.setFormatter方法的典型用法代码示例。如果您正苦于以下问题:Java Tracer.setFormatter方法的具体用法?Java Tracer.setFormatter怎么用?Java Tracer.setFormatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.camel.processor.interceptor.Tracer的用法示例。


在下文中一共展示了Tracer.setFormatter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRouteBuilder

import org.apache.camel.processor.interceptor.Tracer; //导入方法依赖的package包/类
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        public void configure() throws Exception {
            // START SNIPPET: tracingOutExchanges
            Tracer tracer = new Tracer();
            tracer.setTraceOutExchanges(true);

            // we configure the default trace formatter where we can
            // specify which fields we want in the output
            DefaultTraceFormatter formatter = new DefaultTraceFormatter();
            formatter.setShowOutBody(true);
            formatter.setShowOutBodyType(true);

            // set to use our formatter
            tracer.setFormatter(formatter);
            
            getContext().addInterceptStrategy(tracer);
            // END SNIPPET: tracingOutExchanges
            
            from("direct:start").
                transform().body().
                to("mock:a").
                to("mock:b");
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:27,代码来源:TraceInterceptorWithOutBodyTraceTest.java

示例2: camelTracer

import org.apache.camel.processor.interceptor.Tracer; //导入方法依赖的package包/类
@Bean
public Tracer camelTracer() {
	Tracer tracer = new Tracer();
	tracer.setEnabled(true);
	tracer.setTraceExceptions(true);
	tracer.setTraceInterceptors(true);
	tracer.setTraceOutExchanges(false);
	tracer.setLogLevel(LoggingLevel.WARN);
	tracer.setFormatter(formatter());
	tracer.setTraceInterceptors(true);
	return tracer;
}
 
开发者ID:rponte,项目名称:spring-camel,代码行数:13,代码来源:TracerFactory.java

示例3: enableTracing

import org.apache.camel.processor.interceptor.Tracer; //导入方法依赖的package包/类
public void enableTracing()
{
	try
	{
		final InputStream in = getClass().getResourceAsStream("/tracing.log.properties");
		if (in != null)
		{
			LogManager.getLogManager().readConfiguration(in);
		}
	}
	catch (final Exception e)
	{
		throw new RuntimeCamelException(e);
	}

	context.setTracing(true);
	// context.setDelayer(Long.valueOf(1000*1));

	final Tracer tracer = new Tracer();

	final DefaultTraceFormatter formatter = new DefaultTraceFormatter();
	formatter.setShowOutBody(true);
	formatter.setShowOutBodyType(true);
	formatter.setShowException(true);
	// formatter.setShowBreadCrumb(false);
	// formatter.setShowNode(false);
	tracer.setFormatter(formatter);

	tracer.setLogLevel(LoggingLevel.DEBUG);

	context.addInterceptStrategy(tracer);

	Logger.getLogger("org.apache.commons.httpclient.HttpClient")
			.setLevel(Level.WARNING); // logging is not needed
	Logger.getLogger("org.apache.commons.httpclient.Wire")
			.setLevel(Level.WARNING); // logging is not needed
	Logger.getLogger("org.apache.commons.httpclient.HttpConnection")
			.setLevel(Level.WARNING); // logging is not needed
	Logger.getLogger("org.apache.commons.httpclient.HttpMethodBase")
			.setLevel(Level.WARNING); // logging is not needed
	Logger.getLogger("org.apache.camel.impl.converter.BaseTypeConverterRegistry")
			.setLevel(Level.WARNING); // logging is not needed
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:44,代码来源:AbstractEDITest.java


注:本文中的org.apache.camel.processor.interceptor.Tracer.setFormatter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。