Automatically log session input to files #8109

Closed
opened 2026-01-31 01:20:57 +00:00 by claunia · 2 comments
Owner

Originally created by @fischerdouglas on GitHub (May 13, 2020).

Description of the new feature/enhancement

Log every session's output to a file in the specified directory, where there file name and the directory path can be customized with global and session tributes like host, username, date, hour, etc.

Proposed technical implementation details (optional)

"Nothing is created, everything is copied", so the feature is a wish inspired on Putty.
Something like described https://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html#config-logfilename

Bellow goes the description of the feature on the putty docs. The idea is to have something like that, but in Windows Terminal World.


‘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


Originally created by @fischerdouglas on GitHub (May 13, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Log every session's output to a file in the specified directory, where there file name and the directory path can be customized with global and session tributes like host, username, date, hour, etc. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) "Nothing is created, everything is copied", so the feature is a wish inspired on Putty. Something like described https://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html#config-logfilename Bellow goes the description of the feature on the putty docs. The idea is to have something like that, but in Windows Terminal World. ---- ‘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 --- <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 01:20:57 +00:00
Author
Owner

@zadjii-msft commented on GitHub (May 13, 2020):

Thanks for the great write-up! I'm pretty sure this is best tracked in the existing discussion over in #642 - I'd refer to that thread for more discussion.

/dup #642

@zadjii-msft commented on GitHub (May 13, 2020): Thanks for the great write-up! I'm pretty sure this is best tracked in the existing discussion over in #642 - I'd refer to that thread for more discussion. /dup #642
Author
Owner

@ghost commented on GitHub (May 13, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (May 13, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8109