tlog-rec - Man Page
record terminal I/O of a program or a user shell
Synopsis
tlog-rec [OPTION...] [CMD_FILE [CMD_ARG...]]
Description
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.
Options
General options
- -h, --help
Output a command-line usage message and exit.
- -v, --version
Output version information and exit.
- --configuration
Output program configuration in JSON and exit.
- --latency=SECONDS
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
- --payload=BYTES
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"
- --semaphore=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
- --log-input[=BOOL]
Enable/disable logging user input.
If specified as true, user input is logged.
- --log-output[=BOOL]
Enable/disable logging program output.
If specified as true, terminal output is logged.
- --log-window[=BOOL]
Enable/disable logging terminal window size changes.
If specified as true, terminal window size changes are logged.
Logging limit options
- --limit-rate=NUMBER
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
- --limit-burst=NUMBER
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
- --limit-action=STRING
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
- --syslog-facility=STRING
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"
- --syslog-priority=STRING
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
- --journal-priority=STRING
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"
- --journal-augment[=BOOL]
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.
Environment
- TLOG_REC_CONF_FILE
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.
- TLOG_REC_CONF_TEXT
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.
- SHELL
Specifies the shell to run, if no positional arguments are found on the command line.
Files
- /etc/tlog/tlog-rec.conf
The system-wide configuration file
Examples
- 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
Author
Nikolai Kondrashov <spbnick@gmail.com>
Referenced By
tlog-play(8), tlog-rec.conf(5), tlog-rec-session(8).