axiopisty
axiopisty

Reputation: 5146

How to change tmux logs directory from current directory to something else

$ man tmux

...

-v Request verbose logging. Log messages will be saved into tmux-client-PID.log and tmux-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 additional tmux-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

Answers (1)

Nemesis
Nemesis

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

Related Questions