Skip to main content

log (Stream Processor)

Logs the message on the given priority with or without the processed event.

Syntax

log()
log(<STRING> log.message)
log(<BOOL> is.event.logged)
log(<STRING> log.message, <BOOL> is.event.logged)
log(<STRING> priority, <STRING> log.message)
log(<STRING> priority, <STRING> log.message, <BOOL> is.event.logged)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
priorityThe priority/type of this log message (INFO, DEBUG, WARN, FATAL, ERROR, OFF, TRACE).INFOSTRINGYesNo
log.messageThis message will be logged.:STRINGYesYes
is.event.loggedTo log the processed event.trueBOOLYesNo

Example 1

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log();

This query, named 'query1', logs events from the FooStream with the stream worker name message prefix on the default log level INFO. The log events are then selected and inserted into the BarStream. The log() function is used to log events from the FooStream.

Essentially, this query processes records in the FooStream, logs the events with the specified message prefix and log level, and then creates new records in the BarStream with the same data as in the original FooStream records.

Example 2

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log("Sample Event :");

This query, named 'query1', logs events from the FooStream with the message prefix "Sample Event :" on the default log level INFO. The log events are then selected and inserted into the BarStream. The log() function is used to log events from the FooStream with the specified message prefix.

Essentially, this query processes records in the FooStream, logs the events with the specified message prefix and log level, and then creates new records in the BarStream with the same data as in the original FooStream records.

Example 3

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log("DEBUG", "Sample Event :", true);

Logs events with the message prefix "Sample Event :" on log level DEBUG.

Example 4

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log("Event Arrived", false);

For each event logs a message "Event Arrived" on default log level INFO.

Example 5

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log("Sample Event :", true);

Logs events with the message prefix "Sample Event :" on default log level INFO.

Example 6

@info(name = 'query1')
INSERT INTO BarStream
SELECT *
FROM FooStream#log(true);

Logs events with on default log level INFO.