‘Log file name’

PuTTY

4.2.1 ‘Log file name’

In this edit box you enter the name of the file you want to log the session to. The ‘Browse’ button will let you look around your file system to find the right place to put the file; or if you already know exactly where you want it to go, you can just type a pathname into the edit box.

There are a few special features in this box. If you use the & character in the file name box, PuTTY will insert details of the current session in the name of the file it actually opens. The precise replacements it will do are:

  • &Y will be replaced by the current year, as four digits.
  • &M will be replaced by the current month, as two digits.
  • &D will be replaced by the current day of the month, as two digits.
  • &T will be replaced by the current time, as six digits (HHMMSS) with no punctuation.
  • &H will be replaced by the host name you are connecting to.
  • &P will be replaced by the port number you are connecting to on the target host.

For example, if you enter the host name c:\puttylogs\log-&h-&y&m&d-&t.dat, you will end up with files looking like

log-server1.example.com-20010528-110859.dat
log-unixbox.somewhere.org-20010611-221001.dat