Application logs¶
This page describes the application logs produced by each KX Sensors process, and how to configure their location and retention.
Every process within KX Sensors (RDB, IDB, HDB, DBW, etc.) has its own dedicated log. You can look up the logs of each process from the console.
Overview¶
KX Sensors generates one log file per process per day. The file name format is PROC-YYYY.MM.DD.log (for example, kxsRDB_A1-2022.07.08.log). There is also a symbolic link to the current day's file without the date appended; for example, kxsRDB_A1.log.
Log files always begin with information regarding the running instance, the log service context. The following example shows the start of kxsRDB_A1.log:
[root@kxsa logs]# kxsctl log kxsRDB_A1 -i 1
2023.02.09 00:00:00.007 INFO [kxsRDB_A1] LOG
2023.02.09 00:00:00.007 INFO [kxsRDB_A1] LOG Service context: name=kxsRDB_A1 sc=rdb
pid=848 port=20008 udpport=20008 ver= build= domain=A family= seq=0 debug=N cores=32
threads=4
2023.02.09 00:00:00.007 INFO [kxsRDB_A1] LOG Process start time: 2023.02.08
14:38:49.339
2023.02.09 00:00:00.007 INFO [kxsRDB_A1] LOG Load directories: `:/root/kxs/src/kxs-
core`:/root/kxs/src/kxs-test`:/root/kxs/src/kxs-ss`:/root/kxs/src/kxs-ss-node-
4`:/root/kxs/src/host
2023.02.09 00:00:00.007 TRACE [kxsRDB_A1] EMS Received message, stream=emsint
topic=_prtnEnd pos=1827324
2023.02.09 00:00:00.007 TRACE [kxsRDB_A1] EMS Ignoring message from irrelevant topic,
stream=emsint topic=_checkpoint.feed1 pos=1827555
2023.02.09 00:00:00.007 TRACE [kxsRDB_A1] EMS Received message, stream=emsint
topic=_prtnEnd pos=1827686
2023.02.09 00:00:00.008 INFO [kxsRDB_A1] MSG Received prtnEnd message, stream=emsint
pos=1827686
data=[seq=56;node=`A;typ=`EOD;eoiTS=2023.02.09D00:00:00.000000000;soiTS=2023.02.08D23
:50:00.000000000;sodTS=2023.02.08D14:38:49.294401000;date=2023.02.08;prtn=56i;nextDat
e=2023.02.09]
2023.02.09 00:00:00.008 DEBUG [kxsRDB_A1] MDB Executing each, ev=eoia
data=(`emsint;2023.02.08;2023.02.08D23:50:00.000000000;600i;()!();1827686)
2023.02.09 00:00:00.008 DEBUG [kxsRDB_A1] MDL Initializing next virtual partition 58,
SOI TS 2023.02.09 00:00:00
LOG service context¶
The log service context shows the properties that were in effect when the process was run and the timestamp when the process was started.
| Property | Example | Description |
|---|---|---|
| name | kxsRDB_A1 | Process name |
| sc | rdb | Service class |
| pid | 848 | Process ID |
| port | 20008 | Port used for sensor data |
| udpport | 20008 | Port used for UDP messaging (usually the same as the port). Processes send data to Mon via the UDP port. |
| ver | Process version | |
| build | 3.0.100 | Build version (reserved for future use) |
| domain | A | Node |
| family | Family (reserved for future use) | |
| seq | 0 | Sequence number within service class. For example, 1 for kxsRDB_A1, 2 for kxsRDB_A2, 0 for kxsDBW_A. |
| debug | N | Whether or not the process was started with -debug (used to load debug utils) |
| core | 32 | Number of cores |
| threads | 4 | Number of threads |
Configure log location and retention¶
You configure the log file location and the number of days of log files to retain in your environment variables file, $KXS_ROOT/kxsenv:
| Parameter | Description |
|---|---|
KXS_LOG_DIR |
The directory for your application logs. |
KXS_LOG_RET |
The number of days to retain your application logs. |
etcd and qetcd log files¶
KX Sensors also writes etcd.log and qetcd.log for the etcd and qetcd services. Their directory is controlled by the same KXS_LOG_DIR environment variable described above.
RT log files¶
As of KX Sensors 3.3, RT runs directly on the host and writes its application logs to KXS_LOG_DIR alongside every other KX Sensors process, one log per stream — for example, kxsRT_A-emsint.log. Replicator logs are written under $KXS_LOG_DIR/kxi_c_sdk_logs. See RT log files.