.\" Process this file with .\" groff -man -Tascii .\" .\" Copyright (C) 2016-2017 Red Hat .\" .\" This file is part of tlog. .\" .\" Tlog is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" Tlog is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with tlog; if not, write to the Free Software .\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA .\" .TH tlog-rec "8" "May 2017" "Tlog" .SH NAME tlog-rec \- record terminal I/O of a program or a user shell .SH SYNOPSIS .B tlog-rec [OPTION...] [CMD_FILE [CMD_ARG...]] .SH DESCRIPTION .B 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. .B 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. .SH OPTIONS .SS General options .TP .B -h, --help Output a command-line usage message and exit. .TP .B -v, --version Output version information and exit. .TP .B --configuration Output program configuration in JSON and exit. .TP .B --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 .br .TP .B --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 .br .TP .B -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" .br .TP .B --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. .SS Logged data set options .TP .B --log-input[=BOOL] Enable/disable logging user input. If specified as true, user input is logged. .TP .B --log-output[=BOOL] Enable/disable logging program output. If specified as true, terminal output is logged. .TP .B --log-window[=BOOL] Enable/disable logging terminal window size changes. If specified as true, terminal window size changes are logged. .SS Logging limit options .TP .B --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 .br .TP .B --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 .br .TP .B --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" .br .SS File writer options .TP .B -o, --file-path=FILE Log to FILE file. FILE is the "file" writer log file path. .SS Syslog writer options .TP .B --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" .br .TP .B --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" .br .SS Journal writer options .TP .B --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" .br .TP .B --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. .SH ENVIRONMENT .TP 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. .TP 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. .TP SHELL Specifies the shell to run, if no positional arguments are found on the command line. .SH FILES .TP /etc/tlog/tlog-rec.conf The system-wide configuration file .SH EXAMPLES .TP Record a vim session to a file: .B tlog-rec -o vim.log vim .TP Record user input only: .B tlog-rec --log-input=on --log-output=off --log-window=off .TP Record with minimal latency: .B tlog-rec --latency=1 .SH SEE ALSO tlog-rec.conf(5), tlog-rec-session(8), tlog-play(8) .SH AUTHOR Nikolai Kondrashov