2013-03-06-log-all-putty-sessions-by-default.md 1.35 KB
Newer Older
Danesh Manoharan's avatar
Danesh Manoharan committed
1
2
---
title: Log all Putty sessions by default
3
author: Danesh Manoharan
Danesh Manoharan's avatar
Danesh Manoharan committed
4
5
6
7
8
9
10
date: 2013-03-05T22:59:25+00:00
dsq_thread_id:
  - 1120051936

---
Putty has a feature to log your sessions to log files. This is a handy and I use it a lot. Comes in handy when you want to roll back what you did or to simply remember a command you ran.

11
Session logging is not enabled by default but if you want logging enabled by default for all your sessions then here's how.
Danesh Manoharan's avatar
Danesh Manoharan committed
12

13
Fire up Putty and go to the "Logging" tab. Check "Printable output" option and insert your desired log file name and location into the location field.
Danesh Manoharan's avatar
Danesh Manoharan committed
14

Danesh Manoharan's avatar
Danesh Manoharan committed
15
![PuTTY Configuration_2013-03-05_22-52-01](/wp-content/uploads/2013/03/PuTTY-Configuration_2013-03-05_22-52-01-450x432.png)
Danesh Manoharan's avatar
Danesh Manoharan committed
16
17
18

For the log file name, Putty supports the following substitutes.

19
20
21
22
23
&H - Hostname  
&Y - Year (yyyy)  
&M - Month (mm)  
&D - Day (dd)  
&T - Time (hhmmss)
Danesh Manoharan's avatar
Danesh Manoharan committed
24
25
26

D:\Users\username\Dropbox\backup\putty-log\&H-&Y&M&D-&T.log

27
This will log all your sessions into a [dropbox][2] backup folder with the desired naming format. .i.e "hostname-20130305-132319.log"
Danesh Manoharan's avatar
Danesh Manoharan committed
28

29
Go to "Session" , select the "Default Settings" saved session and hit "save" to make this default for all your new sessions.
Danesh Manoharan's avatar
Danesh Manoharan committed
30
31
32
33

NOTE: All your previous saved sessions will need to manually updated.

 [1]: /wp-content/uploads/2013/03/PuTTY-Configuration_2013-03-05_22-52-01.png
Danesh Manoharan's avatar
Danesh Manoharan committed
34
 [2]: http://db.tt/MPUL3zQ