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.LineNumberAware
Log messages to the underlying logging mechanism.
Camel uses sfl4j which allows you to configure logging to the actual logging system.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
ConstructorsConstructorDescriptionLogEndpoint
(String endpointUri, org.apache.camel.Component component) LogEndpoint
(String endpointUri, org.apache.camel.Component component, org.apache.camel.Processor logger) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected org.apache.camel.Processor
Creates the loggerProcessor
to be used.org.apache.camel.Producer
protected void
doInit()
protected void
doStart()
protected void
doStop()
org.apache.camel.spi.ExchangeFormatter
If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.Set the initial delay for stats (in millis)If specified will group message stats by this time interval (in millis)An integer that specifies a group size for throughput logging.getLevel()
Logging level to use.int
org.apache.camel.Processor
The logger name to useAn optional Marker name to use.int
org.slf4j.Logger
org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle
getStyle()
boolean
boolean
isPlain()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
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
Logging level to use.void
setLineNumber
(int lineNumber) void
setLocation
(String location) 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
An optional Marker name to use.void
setMaxChars
(int maxChars) void
setMultiline
(boolean multiline) void
setPlain
(boolean plain) void
setProvidedLogger
(org.slf4j.Logger providedLogger) void
setShowAll
(boolean showAll) void
setShowAllProperties
(boolean showAllProperties) void
setShowBody
(boolean showBody) void
setShowBodyType
(boolean showBodyType) void
setShowCachedStreams
(boolean showCachedStreams) 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
setSourceLocationLoggerName
(boolean sourceLocationLoggerName) 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.DefaultPollingEndpoint
createConsumer
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
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
LogEndpoint
public LogEndpoint() -
LogEndpoint
-
LogEndpoint
public LogEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.Processor logger)
-
-
Method Details
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.ScheduledPollEndpoint
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.ScheduledPollEndpoint
- Throws:
Exception
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceorg.apache.camel.LineNumberAware
-
setLineNumber
public void setLineNumber(int lineNumber) - Specified by:
setLineNumber
in interfaceorg.apache.camel.LineNumberAware
-
getLocation
- Specified by:
getLocation
in interfaceorg.apache.camel.LineNumberAware
-
setLocation
- Specified by:
setLocation
in interfaceorg.apache.camel.LineNumberAware
-
setLogger
public void setLogger(org.apache.camel.Processor logger) -
getLogger
public org.apache.camel.Processor getLogger() -
createProducer
- Specified by:
createProducer
in interfaceorg.apache.camel.Endpoint
- Overrides:
createProducer
in classorg.apache.camel.support.ProcessorEndpoint
- Throws:
Exception
-
createEndpointUri
- Overrides:
createEndpointUri
in classorg.apache.camel.support.DefaultEndpoint
-
getComponent
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
createLogger
protected org.apache.camel.Processor createLogger()Creates the loggerProcessor
to be used. -
getLevel
Logging level to use. The default value is INFO. -
setLevel
Logging level to use. The default value is INFO. -
getMarker
An optional Marker name to use. -
setMarker
An optional Marker name to use. -
getGroupSize
An integer that specifies a group size for throughput logging. -
setGroupSize
An integer that specifies a group size for throughput logging. -
getGroupInterval
If specified will group message stats by this time interval (in millis) -
setGroupInterval
If specified will group message stats by this time interval (in millis) -
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
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
Set the initial delay for stats (in millis) -
setGroupDelay
Set the initial delay for stats (in millis) -
getProvidedLogger
public org.slf4j.Logger getProvidedLogger() -
setProvidedLogger
public void setProvidedLogger(org.slf4j.Logger providedLogger) -
getLoggerName
The logger name to use -
setLoggerName
The logger name to use -
getLogMask
-
setLogMask
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)
-