本文整理汇总了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");
}
};
}
示例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;
}
示例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
}