Reputation: 5146
$ man tmux
...
-v
Request verbose logging. Log messages will be saved intotmux-client-PID.log
andtmux-server-PID.log
files in the current directory, where PID is the PID of the server or client process. If-v
is specified twice, an additionaltmux-out-PID.log
file is generated with a copy of everything tmux writes to the terminal.
I'm just curious if anyone knows if there is some way to specify (by environment variable or some other way) some directory other than the "current directory" where the logs should be written to.
I wasn't able to find this in the documentation.
Upvotes: 1
Views: 409
Reputation: 150
There is a plugin that makes logging in tmux more easy called tmux-logging.
Once the plugin is installed you can record sessions using [Ctrl]+[b]+[Shift]+[p]
and a log file with the nomenclature tmux-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log
will be stored in your $HOME
directory. You can change that by specifying set -g @logging-path "path"
in your .tmux.conf file.
Upvotes: 0