The titan Log Engine

The titan Log Engine is in charge of fetching log messages from a kafka topic and providing it. It can be reached via a websocket connection.

UseCaseDiagram

Building/ running

To run the service simply use go run ./cmd/logengine

or to create an executable file go build ./cmd/logengine

It features the following command line arguments:

Name Options (default) Purpose
port (9007) Port on which the log service serves
log-level info/debug/warning/error Log level
(info)
to-stdout true/false (true) Flag: set to true to print logs to stdout
config-file (internal/app/logengine/config.yaml) Configuration file
kafka 10.14.0.23:9092 URL of the Kafka broker ()
topic titan.logs Topic with the Titan logs in UJO format

Generally, all settings listed above can be done also via environment
variables, whereby the variables are composed of a prefix (TITAN_LE)
and the argument using snake case:

TITAN_LE_ARGUMENT, e.g. TITAN_LE_LOG_LEVEL

Usage

Fetching log messages

Open a websocket connection to HOST:PORT. The Log Engine will send back log message objects as JSON objects until the connection is closed.

Unsubscribing from the Log Engine

You can unsubscribe from Log Engine by sending a json object:

{
"payload": "stop"
}

Filtering

To filter the log messages you need to send a json object with the key:value pairs of the Log message object you want to filter for, e.g.

{
"payload": { "Severity": "Info"}
}

Log message object

structure of a log message object is

Items:

Name Type Doc Constraints
Timestamp map time stamp of creation
Severity string Severity level of the log message
Hostname string Name of the sending host
Servicename string Name of the sending service
Message string Log Message
FlowUID string UUID of the flow
BrickUID string UUID of the brick