Package org.apache.camel.component.log
Class LogEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.support.ScheduledPollEndpoint
-
- org.apache.camel.support.DefaultPollingEndpoint
-
- org.apache.camel.support.ProcessorEndpoint
-
- org.apache.camel.component.log.LogEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="1.1.0", scheme="log", title="Log", syntax="log:loggerName", producerOnly=true, category={CORE,MONITORING}) public class LogEndpoint extends org.apache.camel.support.ProcessorEndpoint
Log messages to the underlying logging mechanism. Camel uses sfl4j which allows you to configure logging to the actual logging system.
-
-
Constructor Summary
Constructors Constructor Description LogEndpoint()
LogEndpoint(String endpointUri, org.apache.camel.Component component)
LogEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.Processor logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createEndpointUri()
protected org.apache.camel.Processor
createLogger()
Creates the loggerProcessor
to be used.org.apache.camel.Producer
createProducer()
protected void
doInit()
protected void
doStart()
protected void
doStop()
LogComponent
getComponent()
org.apache.camel.spi.ExchangeFormatter
getExchangeFormatter()
Boolean
getGroupActiveOnly()
If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.Long
getGroupDelay()
Set the initial delay for stats (in millis)Long
getGroupInterval()
If specified will group message stats by this time interval (in millis)Integer
getGroupSize()
An integer that specifies a group size for throughput logging.String
getLevel()
Logging level to use.org.apache.camel.Processor
getLogger()
String
getLoggerName()
The logger name to useBoolean
getLogMask()
String
getMarker()
An optional Marker name to use.int
getMaxChars()
org.slf4j.Logger
getProvidedLogger()
org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle
getStyle()
boolean
isMultiline()
boolean
isShowAll()
boolean
isShowBody()
boolean
isShowBodyType()
boolean
isShowCaughtException()
boolean
isShowException()
boolean
isShowExchangeId()
boolean
isShowExchangePattern()
boolean
isShowFiles()
boolean
isShowFuture()
boolean
isShowHeaders()
boolean
isShowProperties()
boolean
isShowStackTrace()
boolean
isShowStreams()
boolean
isSkipBodyLineSeparator()
void
setExchangeFormatter(org.apache.camel.spi.ExchangeFormatter exchangeFormatter)
To use a custom exchange formattervoid
setGroupActiveOnly(Boolean groupActiveOnly)
If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.void
setGroupDelay(Long groupDelay)
Set the initial delay for stats (in millis)void
setGroupInterval(Long groupInterval)
If specified will group message stats by this time interval (in millis)void
setGroupSize(Integer groupSize)
An integer that specifies a group size for throughput logging.void
setLevel(String level)
Logging level to use.void
setLogger(org.apache.camel.Processor logger)
void
setLoggerName(String loggerName)
The logger name to usevoid
setLogMask(Boolean logMask)
If true, mask sensitive information like password or passphrase in the log.void
setMarker(String marker)
An optional Marker name to use.void
setMaxChars(int maxChars)
void
setMultiline(boolean multiline)
void
setProvidedLogger(org.slf4j.Logger providedLogger)
void
setShowAll(boolean showAll)
void
setShowBody(boolean showBody)
void
setShowBodyType(boolean showBodyType)
void
setShowCaughtException(boolean showCaughtException)
void
setShowException(boolean showException)
void
setShowExchangeId(boolean showExchangeId)
void
setShowExchangePattern(boolean showExchangePattern)
void
setShowFiles(boolean showFiles)
void
setShowFuture(boolean showFuture)
void
setShowHeaders(boolean showHeaders)
void
setShowProperties(boolean showProperties)
void
setShowStackTrace(boolean showStackTrace)
void
setShowStreams(boolean showStreams)
void
setSkipBodyLineSeparator(boolean skipBodyLineSeparator)
void
setStyle(org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle style)
-
Methods inherited from class org.apache.camel.support.ProcessorEndpoint
createPollingConsumer, createProcessor, getProcessor, onExchange, setProcessor
-
Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createExchange, createExchange, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.ScheduledPollEndpoint
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.ScheduledPollEndpoint
- Throws:
Exception
-
setLogger
public void setLogger(org.apache.camel.Processor logger)
-
getLogger
public org.apache.camel.Processor getLogger()
-
createProducer
public org.apache.camel.Producer createProducer() throws Exception
- Specified by:
createProducer
in interfaceorg.apache.camel.Endpoint
- Overrides:
createProducer
in classorg.apache.camel.support.ProcessorEndpoint
- Throws:
Exception
-
createEndpointUri
protected String createEndpointUri()
- Overrides:
createEndpointUri
in classorg.apache.camel.support.DefaultEndpoint
-
getComponent
public LogComponent getComponent()
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
createLogger
protected org.apache.camel.Processor createLogger()
Creates the loggerProcessor
to be used.
-
getLevel
public String getLevel()
Logging level to use. The default value is INFO.
-
setLevel
public void setLevel(String level)
Logging level to use. The default value is INFO.
-
getMarker
public String getMarker()
An optional Marker name to use.
-
setMarker
public void setMarker(String marker)
An optional Marker name to use.
-
getGroupSize
public Integer getGroupSize()
An integer that specifies a group size for throughput logging.
-
setGroupSize
public void setGroupSize(Integer groupSize)
An integer that specifies a group size for throughput logging.
-
getGroupInterval
public Long getGroupInterval()
If specified will group message stats by this time interval (in millis)
-
setGroupInterval
public void setGroupInterval(Long groupInterval)
If specified will group message stats by this time interval (in millis)
-
getGroupActiveOnly
public Boolean getGroupActiveOnly()
If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.
-
setGroupActiveOnly
public void setGroupActiveOnly(Boolean groupActiveOnly)
If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.
-
getGroupDelay
public Long getGroupDelay()
Set the initial delay for stats (in millis)
-
setGroupDelay
public void setGroupDelay(Long groupDelay)
Set the initial delay for stats (in millis)
-
getProvidedLogger
public org.slf4j.Logger getProvidedLogger()
-
setProvidedLogger
public void setProvidedLogger(org.slf4j.Logger providedLogger)
-
getLoggerName
public String getLoggerName()
The logger name to use
-
setLoggerName
public void setLoggerName(String loggerName)
The logger name to use
-
getLogMask
public Boolean getLogMask()
-
setLogMask
public void setLogMask(Boolean logMask)
If true, mask sensitive information like password or passphrase in the log.
-
getExchangeFormatter
public org.apache.camel.spi.ExchangeFormatter getExchangeFormatter()
-
setExchangeFormatter
public void setExchangeFormatter(org.apache.camel.spi.ExchangeFormatter exchangeFormatter)
To use a custom exchange formatter
-
isShowExchangeId
public boolean isShowExchangeId()
-
setShowExchangeId
public void setShowExchangeId(boolean showExchangeId)
-
isShowExchangePattern
public boolean isShowExchangePattern()
-
setShowExchangePattern
public void setShowExchangePattern(boolean showExchangePattern)
-
isShowProperties
public boolean isShowProperties()
-
setShowProperties
public void setShowProperties(boolean showProperties)
-
isShowHeaders
public boolean isShowHeaders()
-
setShowHeaders
public void setShowHeaders(boolean showHeaders)
-
isSkipBodyLineSeparator
public boolean isSkipBodyLineSeparator()
-
setSkipBodyLineSeparator
public void setSkipBodyLineSeparator(boolean skipBodyLineSeparator)
-
isShowBody
public boolean isShowBody()
-
setShowBody
public void setShowBody(boolean showBody)
-
isShowBodyType
public boolean isShowBodyType()
-
setShowBodyType
public void setShowBodyType(boolean showBodyType)
-
isShowException
public boolean isShowException()
-
setShowException
public void setShowException(boolean showException)
-
isShowCaughtException
public boolean isShowCaughtException()
-
setShowCaughtException
public void setShowCaughtException(boolean showCaughtException)
-
isShowStackTrace
public boolean isShowStackTrace()
-
setShowStackTrace
public void setShowStackTrace(boolean showStackTrace)
-
isShowAll
public boolean isShowAll()
-
setShowAll
public void setShowAll(boolean showAll)
-
isMultiline
public boolean isMultiline()
-
setMultiline
public void setMultiline(boolean multiline)
-
isShowFuture
public boolean isShowFuture()
-
setShowFuture
public void setShowFuture(boolean showFuture)
-
isShowStreams
public boolean isShowStreams()
-
setShowStreams
public void setShowStreams(boolean showStreams)
-
isShowFiles
public boolean isShowFiles()
-
setShowFiles
public void setShowFiles(boolean showFiles)
-
getMaxChars
public int getMaxChars()
-
setMaxChars
public void setMaxChars(int maxChars)
-
getStyle
public org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle getStyle()
-
setStyle
public void setStyle(org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle style)
-
-