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.LineNumberAware,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 implements org.apache.camel.LineNumberAwareLog 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 StringcreateEndpointUri()protected org.apache.camel.ProcessorcreateLogger()Creates the loggerProcessorto be used.org.apache.camel.ProducercreateProducer()protected voiddoInit()protected voiddoStart()protected voiddoStop()LogComponentgetComponent()org.apache.camel.spi.ExchangeFormattergetExchangeFormatter()BooleangetGroupActiveOnly()If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.LonggetGroupDelay()Set the initial delay for stats (in millis)LonggetGroupInterval()If specified will group message stats by this time interval (in millis)IntegergetGroupSize()An integer that specifies a group size for throughput logging.StringgetLevel()Logging level to use.intgetLineNumber()StringgetLocation()org.apache.camel.ProcessorgetLogger()StringgetLoggerName()The logger name to useBooleangetLogMask()StringgetMarker()An optional Marker name to use.intgetMaxChars()org.slf4j.LoggergetProvidedLogger()org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStylegetStyle()booleanisMultiline()booleanisPlain()booleanisShowAll()booleanisShowAllProperties()booleanisShowBody()booleanisShowBodyType()booleanisShowCachedStreams()booleanisShowCaughtException()booleanisShowException()booleanisShowExchangeId()booleanisShowExchangePattern()booleanisShowFiles()booleanisShowFuture()booleanisShowHeaders()booleanisShowProperties()booleanisShowStackTrace()booleanisShowStreams()booleanisSkipBodyLineSeparator()booleanisSourceLocationLoggerName()voidsetExchangeFormatter(org.apache.camel.spi.ExchangeFormatter exchangeFormatter)To use a custom exchange formattervoidsetGroupActiveOnly(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.voidsetGroupDelay(Long groupDelay)Set the initial delay for stats (in millis)voidsetGroupInterval(Long groupInterval)If specified will group message stats by this time interval (in millis)voidsetGroupSize(Integer groupSize)An integer that specifies a group size for throughput logging.voidsetLevel(String level)Logging level to use.voidsetLineNumber(int lineNumber)voidsetLocation(String location)voidsetLogger(org.apache.camel.Processor logger)voidsetLoggerName(String loggerName)The logger name to usevoidsetLogMask(Boolean logMask)If true, mask sensitive information like password or passphrase in the log.voidsetMarker(String marker)An optional Marker name to use.voidsetMaxChars(int maxChars)voidsetMultiline(boolean multiline)voidsetPlain(boolean plain)voidsetProvidedLogger(org.slf4j.Logger providedLogger)voidsetShowAll(boolean showAll)voidsetShowAllProperties(boolean showAllProperties)voidsetShowBody(boolean showBody)voidsetShowBodyType(boolean showBodyType)voidsetShowCachedStreams(boolean showCachedStreams)voidsetShowCaughtException(boolean showCaughtException)voidsetShowException(boolean showException)voidsetShowExchangeId(boolean showExchangeId)voidsetShowExchangePattern(boolean showExchangePattern)voidsetShowFiles(boolean showFiles)voidsetShowFuture(boolean showFuture)voidsetShowHeaders(boolean showHeaders)voidsetShowProperties(boolean showProperties)voidsetShowStackTrace(boolean showStackTrace)voidsetShowStreams(boolean showStreams)voidsetSkipBodyLineSeparator(boolean skipBodyLineSeparator)voidsetSourceLocationLoggerName(boolean sourceLocationLoggerName)voidsetStyle(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:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.camel.support.ScheduledPollEndpoint- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.apache.camel.support.ScheduledPollEndpoint- Throws:
Exception
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumberin interfaceorg.apache.camel.LineNumberAware
-
setLineNumber
public void setLineNumber(int lineNumber)
- Specified by:
setLineNumberin interfaceorg.apache.camel.LineNumberAware
-
getLocation
public String getLocation()
- Specified by:
getLocationin interfaceorg.apache.camel.LineNumberAware
-
setLocation
public void setLocation(String location)
- Specified by:
setLocationin interfaceorg.apache.camel.LineNumberAware
-
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:
createProducerin interfaceorg.apache.camel.Endpoint- Overrides:
createProducerin classorg.apache.camel.support.ProcessorEndpoint- Throws:
Exception
-
createEndpointUri
protected String createEndpointUri()
- Overrides:
createEndpointUriin classorg.apache.camel.support.DefaultEndpoint
-
getComponent
public LogComponent getComponent()
- Overrides:
getComponentin classorg.apache.camel.support.DefaultEndpoint
-
createLogger
protected org.apache.camel.Processor createLogger()
Creates the loggerProcessorto 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)
-
isShowAllProperties
public boolean isShowAllProperties()
-
setShowAllProperties
public void setShowAllProperties(boolean showAllProperties)
-
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)
-
isShowCachedStreams
public boolean isShowCachedStreams()
-
setShowCachedStreams
public void setShowCachedStreams(boolean showCachedStreams)
-
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)
-
isPlain
public boolean isPlain()
-
setPlain
public void setPlain(boolean plain)
-
isSourceLocationLoggerName
public boolean isSourceLocationLoggerName()
-
setSourceLocationLoggerName
public void setSourceLocationLoggerName(boolean sourceLocationLoggerName)
-
-