Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Only want to print 10 lines stacktrace...

$
0
0
In my route i have this:

.onException(Exception.class).process(new Log()).end()

That calls this bean:

public class Log extends Exception implements Processor {
public static final String ROUTING_KEY = "datacentral";

@Override
public void process(Exchange exchange) throws Exception {

Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
Exception.class);

System.out.println("FJA Exchange: " + cause);
System.out.println("FJA Exchange1: " + cause.getStackTrace());

StackTraceElement[] stackTrace = cause.getStackTrace();

StackTraceElement[] test = new StackTraceElement[1];

cause.setStackTrace(test);

I want only to print the first 10 lines in the stacktrace, how is this
possible in camel ?

Frank

Viewing all articles
Browse latest Browse all 5648

Trending Articles