org.apache.camel.processor
Class CamelLogProcessor
java.lang.Object
org.apache.camel.processor.CamelLogProcessor
- All Implemented Interfaces:
- AsyncProcessor, Processor
public class CamelLogProcessor
- extends Object
- implements AsyncProcessor
A Processor
which just logs to a CamelLogger
object which can be used
as an exception handler instead of using a dead letter queue.
The name CamelLogger has been chosen to avoid any name clash with log kits
which has a Logger class.
- Version:
CamelLogProcessor
public CamelLogProcessor()
CamelLogProcessor
public CamelLogProcessor(CamelLogger log)
CamelLogProcessor
public CamelLogProcessor(CamelLogger log,
ExchangeFormatter formatter)
toString
public String toString()
- Overrides:
toString
in class Object
process
public void process(Exchange exchange)
throws Exception
- Description copied from interface:
Processor
- Processes the message exchange
- Specified by:
process
in interface Processor
- Parameters:
exchange
- the message exchange
- Throws:
Exception
- if an internal processing error has occurred.
process
public boolean process(Exchange exchange,
AsyncCallback callback)
- Description copied from interface:
AsyncProcessor
- Processes the message exchange.
Similar to
Processor.process(org.apache.camel.Exchange)
, but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception
would be set on the Exchange
.
- Specified by:
process
in interface AsyncProcessor
- Parameters:
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.
- Returns:
- (doneSync) true to continue execute synchronously, false to continue being executed asynchronously
process
public void process(Exchange exchange,
Throwable exception)
process
public void process(Exchange exchange,
String message)
getLogger
public CamelLogger getLogger()
setLogName
public void setLogName(String logName)
setLevel
public void setLevel(LoggingLevel level)
setMarker
public void setMarker(String marker)
Apache Camel