Class LogSink
- java.lang.Object
-
- io.siddhi.core.stream.output.sink.Sink
-
- io.siddhi.core.stream.output.sink.LogSink
-
- All Implemented Interfaces:
SinkListener
public class LogSink extends Sink
Implementation ofSinkwhich can be used as a logger. This will log the output events in the output stream with user specified priority and a prefix
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.siddhi.core.stream.output.sink.Sink
Sink.OnErrorAction
-
-
Field Summary
-
Fields inherited from class io.siddhi.core.stream.output.sink.Sink
isTryingToConnect
-
-
Constructor Summary
Constructors Constructor Description LogSink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()Called to connect to the backend before events are publishedvoiddestroy()Called at the end to clean all the resources consumedvoiddisconnect()Called after all publishing is done, or when ConnectionUnavailableException is thrownprotected ServiceDeploymentInfoexposeServiceDeploymentInfo()Give information to the deployment about the service exposed by the sink.String[]getSupportedDynamicOptions()Supported dynamic options by the transportClass[]getSupportedInputEventClasses()protected StateFactory<State>init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition, OptionHolder optionHolder, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext)Will be called for initialing theSinkvoidpublish(Object payload, DynamicOptions transportOptions, State s)Sending events via output transport-
Methods inherited from class io.siddhi.core.stream.output.sink.Sink
connectWithRetry, getHandler, getMapper, getServiceDeploymentInfoList, getStreamDefinition, getType, init, initOnlyTransport, isConnected, isStateful, onError, publish, retryPublish, setConnected, shutdown
-
-
-
-
Method Detail
-
getSupportedInputEventClasses
public Class[] getSupportedInputEventClasses()
- Specified by:
getSupportedInputEventClassesin classSink
-
exposeServiceDeploymentInfo
protected ServiceDeploymentInfo exposeServiceDeploymentInfo()
Description copied from class:SinkGive information to the deployment about the service exposed by the sink.- Specified by:
exposeServiceDeploymentInfoin classSink- Returns:
- ServiceDeploymentInfo Service related information to the deployment
-
getSupportedDynamicOptions
public String[] getSupportedDynamicOptions()
Description copied from class:SinkSupported dynamic options by the transport- Specified by:
getSupportedDynamicOptionsin classSink- Returns:
- the list of supported dynamic option keys
-
init
protected StateFactory<State> init(io.siddhi.query.api.definition.StreamDefinition outputStreamDefinition, OptionHolder optionHolder, ConfigReader sinkConfigReader, SiddhiAppContext siddhiAppContext)
Description copied from class:SinkWill be called for initialing theSink- Specified by:
initin classSink- Parameters:
outputStreamDefinition- containing stream definition bind to theSinkoptionHolder- Option holder containing static and dynamic options related to theSinksinkConfigReader- this hold theSinkextensions configuration reader.siddhiAppContext-SiddhiAppContextof the parent siddhi app.
-
publish
public void publish(Object payload, DynamicOptions transportOptions, State s) throws ConnectionUnavailableException
Description copied from class:SinkSending events via output transport- Specified by:
publishin classSink- Parameters:
payload- payload of the eventtransportOptions- of the event constructing the payloads- current state of the sink- Throws:
ConnectionUnavailableException- throw when connections are unavailable.
-
connect
public void connect() throws ConnectionUnavailableExceptionDescription copied from class:SinkCalled to connect to the backend before events are published- Specified by:
connectin classSink- Throws:
ConnectionUnavailableException- if it cannot connect to the backend
-
disconnect
public void disconnect()
Description copied from class:SinkCalled after all publishing is done, or when ConnectionUnavailableException is thrown- Specified by:
disconnectin classSink
-
-