Skip to content

Look up log files

This page explains how to view and follow process log files using the kxsctl log command and its flags.

You look up your log files using kxsctl log. You can view the logs of a process on any node, not only the node you run the command from.

Syntax kxsctl log [target] [flags]
Flags -c (cat) Write the log out in full instead of paging it, for piping to another command.
-d (date) Log to open, either a day (YYYY.MM.DD) or a single hour (YYYY.MM.DD-HH).
-f (follow) Follow the current log, continuing across an hourly rollover.
-i (index) Open a log by its position in the list of available logs, where 1 is the current log.

Changes in v3.3

kxsctl log replaces kxsctl show log. The -a/--age, -e/--no-less and -n/--lines flags have been removed, and kxsctl log now understands hourly log rollover.

If you name a target without -d or -i, kxsctl log lists the logs available for that target so you can select one. The following example opens the current log for DBW on the current node in less:

[root@kxsa /]# kxsctl log dbw -i 1
2023.02.27 22:28:49.475 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsMDL_A domain=A ts=2023.02.27 22:28:49.475651000
2023.02.27 22:28:50.001 TRACE [kxsDBW_A] EMS Ignoring message from irrelevant topic, stream=emsint topic=_checkpoint.feed2 pos=762776
2023.02.27 22:28:50.001 TRACE [kxsDBW_A] EMS Ignoring message from irrelevant topic, stream=emsint topic=_checkpoint.feed1 pos=762907
2023.02.27 22:28:50.492 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsSDL_A1 domain=A ts=2023.02.27 22:28:50.492517000

To open the log for a particular day or hour, use -d:

[root@kxsa /]# kxsctl log dbw -d 2023.02.27
[root@kxsa /]# kxsctl log dbw -d 2023.02.27-22

To follow the current log, use -f. Following continues across an hourly rollover, so you don't have to reopen the log when a new file starts:

[root@kxsa /]# kxsctl log dbw -f
2023.02.27 22:28:55.389 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsSDL_A2 domain=A ts=2023.02.27 22:28:55.389483000
2023.02.27 22:28:55.476 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsMDL_A domain=A ts=2023.02.27 22:28:55.476186000
2023.02.27 22:28:56.492 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsSDL_A1 domain=A ts=2023.02.27 22:28:56.492460000
2023.02.27 22:28:57.389 TRACE [kxsDBW_A] COMM MC message received, cn=.mcha proc=kxsSDL_A2 domain=A ts=2023.02.27 22:28:57.389467000

To process a log with other command-line tools, use -c so that the log is written out in full rather than paged:

[root@kxsa /]# kxsctl log dbw -i 1 -c | grep ERROR

Next steps