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

    Constructors
    Constructor
    Description
     
    LogEndpoint(String endpointUri, org.apache.camel.Component component)
     
    LogEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.Processor logger)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    protected org.apache.camel.Processor
    Creates the logger Processor to be used.
    org.apache.camel.Producer
     
    protected void
     
    protected void
     
    protected void
     
     
    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.
    Logging level to use.
    int
     
     
    org.apache.camel.Processor
     
    The logger name to use
     
    An optional Marker name to use.
    int
     
    org.slf4j.Logger
     
    org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle
     
    boolean
     
    boolean
     
    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 formatter
    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.
    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 use
    void
    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
    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

      public LogEndpoint(String endpointUri, org.apache.camel.Component component)
    • LogEndpoint

      public LogEndpoint(String endpointUri, org.apache.camel.Component component, org.apache.camel.Processor logger)
  • Method Details

    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.DefaultEndpoint
      Throws:
      Exception
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.ScheduledPollEndpoint
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.ScheduledPollEndpoint
      Throws:
      Exception
    • getLineNumber

      public int getLineNumber()
      Specified by:
      getLineNumber in interface org.apache.camel.LineNumberAware
    • setLineNumber

      public void setLineNumber(int lineNumber)
      Specified by:
      setLineNumber in interface org.apache.camel.LineNumberAware
    • getLocation

      public String getLocation()
      Specified by:
      getLocation in interface org.apache.camel.LineNumberAware
    • setLocation

      public void setLocation(String location)
      Specified by:
      setLocation in interface org.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:
      createProducer in interface org.apache.camel.Endpoint
      Overrides:
      createProducer in class org.apache.camel.support.ProcessorEndpoint
      Throws:
      Exception
    • createEndpointUri

      protected String createEndpointUri()
      Overrides:
      createEndpointUri in class org.apache.camel.support.DefaultEndpoint
    • getComponent

      public LogComponent getComponent()
      Overrides:
      getComponent in class org.apache.camel.support.DefaultEndpoint
    • createLogger

      protected org.apache.camel.Processor createLogger()
      Creates the logger Processor 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)
    • 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)