Your company here, and a link to your site. Click to find out more.

tlog-rec - Man Page

record terminal I/O of a program or a user shell


tlog-rec [OPTION...] [CMD_FILE [CMD_ARG...]]


Tlog-rec is a terminal I/O logging program. It starts a program under a pseudo-TTY, connects it to the actual terminal and logs whatever passes between them including user input, program output, and terminal window size changes.

CMD_FILE argument specifies the program to run and record. If CMD_FILE contains a slash (/) character, then it is assumed to contain a path to the program to run. Otherwise a program file with CMD_FILE name is searched for in directories specified with the PATH environment variable. If this variable is not set, then the current directory is searched, followed by the system-default directories output by "getconf CS_PATH", which is usually "/bin:/usr/bin".

CMD_ARG arguments are used as arguments to the program to run and record.

If no non-option arguments are specified, then tlog-rec starts and records a user shell specified with the SHELL environment variable, or if that is not set, it starts the shell specified in the NSS database for the user tlog-rec runs as.

Tlog-rec loads its parameters first from the system-wide configuration file /etc/tlog/tlog-rec.conf, then from the file pointed at by TLOG_REC_CONF_FILE environment variable (if set), then from the contents of the TLOG_REC_CONF_TEXT environment variable (if set), and then from command-line options. Parameters from each of these sources override the previous one in turn.


General options

-h,  --help

Output a command-line usage message and exit.

-v,  --version

Output version information and exit.


Output program configuration in JSON and exit.


Cache captured data SECONDS seconds before logging.

SECONDS is the number of seconds to cache captured data for before logging. The encoded data which does not reach payload size stays in memory and is not logged until this number of seconds elapses.

Value minimum: 1


Limit encoded data to BYTES bytes.

BYTES is the maximum encoded data (payload) size per message, bytes. As soon as payload exceeds this number of bytes, it is formatted into a message and logged.

Value minimum: 32

-w,  --writer=STRING

Use STRING log writer (journal/syslog/file, default file).

STRING is the type of "log writer" to use for logging. The writer needs to be configured using its dedicated parameters.

Value should be one of: "journal", "syslog", "file"


Write "READY" to FILE when recording is setup.

FILE is a path to a "semaphore" file to write string "READY" to, when the  recording setup is done, and I/O can be passed to and from the  recorded program.

Logged data set options


Enable/disable logging user input.

If specified as true, user input is logged.


Enable/disable logging program output.

If specified as true, terminal output is logged.


Enable/disable logging terminal window size changes.

If specified as true, terminal window size changes are logged.

Logging limit options


Set logging rate limit to NUMBER of message bytes/sec.

NUMBER is the maximum rate messages could be logged at, bytes/sec.

Value minimum: 0


Set logging burst limit to NUMBER of message bytes.

NUMBER is the number of bytes by which logged messages are allowed to exceed the rate limit momentarily, i.e. "burstiness".

Value minimum: 0


Perform STRING action above limits (pass/delay/drop).

STRING is the logging limit action. If set to "pass" no logging limits will be applied. If set to "delay", logging will be throttled. If set to "drop", messages exceeding limits will be dropped.

Value should be one of: "pass", "delay", "drop"

File writer options

-o,  --file-path=FILE

Log to FILE file.

FILE is the "file" writer log file path.

Syslog writer options


Log with STRING syslog facility.

STRING is the syslog facility "syslog" writer should use for messages.

Value should be one of: "auth", "authpriv", "cron", "daemon", "ftp", "kern", "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7", "lpr", "mail", "news", "syslog", "user", "uucp"


Log with STRING syslog priority.

STRING is the syslog priority "syslog" writer should use for messages.

Value should be one of: "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"

Journal writer options


Log with STRING syslog-style priority.

STRING is the syslog-style priority "journal" writer should use for messages.

Value should be one of: "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"


Enable/disable adding extra journal fields.

If specified as true, the "journal" writer copies the following JSON fields to Journal fields: user -> TLOG_USER, session -> TLOG_SESSION, rec -> TLOG_REC, and id -> TLOG_ID.



Specifies the location of a configuration file to be read. The configuration parameters in this file override the ones in the system-wide configuration file /etc/tlog/tlog-rec.conf.


Specifies the configuration text to be read. The configuration parameters in this variable override the ones in the file specified with TLOG_REC_CONF_FILE.


Specifies the shell to run, if no positional arguments are found on the command line.



The system-wide configuration file


Record a vim session to a file:

tlog-rec -o vim.log vim

Record user input only:

tlog-rec --log-input=on --log-output=off --log-window=off

Record with minimal latency:

tlog-rec --latency=1

See Also

tlog-rec.conf(5), tlog-rec-session(8), tlog-play(8)


Nikolai Kondrashov <spbnick@gmail.com>

Referenced By

tlog-play(8), tlog-rec.conf(5), tlog-rec-session(8).

May 2017 Tlog