Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Teraterm log and replay functions

News Telnet Clients Recommended Links Teraterm Macros Reference for macrolanguage Invoking Teraterm from command line Highlights of enhancements in latest versions
Teraterm logging  CygTerm+ SSH Password-less SSH login TTSSH Using Pageant for authentication Usage of SCP with Teraterm
GNU Screen Exceed HostExplorer Putty Telnet protocol Teraterm connect command LogMeTT TTPMenu
Expect   Tips Admin Horror Stories Unix History Humor Etc

Bases on stack overflow article  logging - Change log file name of teraterm log you can add timestamp in the long, which is mandatory if you open several terminals with logging.

I would like to change the default log file name of teraterm terminal log. What I would like to do automatically create/append log in a file name like "loggedinhost-teraterm.log"

I found following ini setting for log file. It also uses strftime to format log filename.

    ; Default Log file name. You can specify strftime format to here.
    LogDefaultName=teraterm "%d %b %Y" .log
    ; Default path to save the log file.
    LogDefaultPath=
    ; Auto start logging with default log file name.
    LogAutoStart=on

I have modified it to include date.

Is there any way to prefix hostname in logfile name

Fox eg,

myserver01-teraterm.log
myserver02-teraterm.logfile
myserver03-teraterm.log

Romme ,

I had the same issue, and was able to solve my problem by adding &h like below;

; Default Log file name. You can specify strftime format to here. LogDefaultName=teraterm &h %d %b %y.log ; Default path to save the log file. LogDefaultPath=C:\Users\Logs ; Auto start logging with default log file name. LogAutoStart=on

https://ttssh2.osdn.jp/manual/en/menu/setup-additional.html

"Log" tab

View log editor

Specify the editor that is used for display log file

Default log file name(strftime format)

Specify default log file name. It can include a format of strftime.

&h      Host name(or empty when not connecting)
&p      TCP port number(or empty when not connecting, not TCP connection)
&u      Logon user name
%a      Abbreviated weekday name
%A      Full weekday name
%b      Abbreviated month name
%B      Full month name
%c      Date and time representation appropriate for locale
%d      Day of month as decimal number (01 - 31)
%H      Hour in 24-hour format (00 - 23)
%I      Hour in 12-hour format (01 - 12)
%j      Day of year as decimal number (001 - 366)
%m      Month as decimal number (01 - 12)
%M      Minute as decimal number (00 -  59)
%p      Current locale's A.M./P.M. indicator for 12-hour clock
%S      Second as decimal number (00 - 59)
%U      Week of year as decimal number, with Sunday as first day of week (00 - 53)
%w      Weekday as decimal number (0 - 6; Sunday is 0)
%W      Week of year as decimal number, with Monday as first day of week (00 - 53)
%x      Date representation for current locale
%X      Time representation for current locale
%y      Year without century, as decimal number (00 - 99)
%Y      Year with century, as decimal number
%z, %Z  Either the time-zone name or time zone abbreviation, depending on registry settings;
    no characters if time zone is unknown
%%      Percent sign

example:

teraterm-&h-%Y%m%d_%H_%M_%S.log

Log and replay functions

You can save the host data to the file if you use Tera Term logging function.

Log to the file

You can log characters received from the host. Execute the [File] Log command to start logging.

Do in the following commands:

  1. Do [File] Log command.
  2. "Tera Term: Log" dialog box will be shown.

    Input the saving file name to `File Name:'.
    All host data will be written to the file if you check `Binary' option.
    KANJI, CR and LF codes are converted to host character code, written to the file if you uncheck `Binary' option. However, the escape sequences are not written to the file.
    The host data will append the file if you check `Append' option.
    The host data will overwrite the file if you uncheck `Append' option.
     

  3. Push OK button, "Tera Term: Log" icon will be shown. And logging will start.
  4. Push Close or Pause button on the logging dialog box if you finish the logging or temporarily stop. Pause button will change into Start button if you push Pause button, the logging will restart.

To browse log files, which contain escape sequences, it is convenient to use the replay function of Tera Term. To replay a log file.

Replay the log file

Run Tera Term with command line in the following:

TTERMPRO /R=<log file name>

Tera Term analyzes the specified log file and understands the escape sequence datas. If so, the contents of log file will be displayed in Tera Term window as if the characters were received from the host. We call this function 'replay log'.

And also, you can also use 'Host:' on the [File] New connection command.

/R=<log file name>

Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Apr 12, 2020] logging - Change log file name of teraterm log - Stack Overflow

Apr 12, 2020 | stackoverflow.com

Change log file name of teraterm log Ask Question Asked 4 years, 8 months ago Active 10 months ago Viewed 5k times


pmverma ,

I would like to change the default log file name of teraterm terminal log. What I would like to do automatically create/append log in a file name like "loggedinhost-teraterm.log"

I found following ini setting for log file. It also uses strftime to format log filename.

    ; Default Log file name. You can specify strftime format to here.
    LogDefaultName=teraterm "%d %b %Y" .log
    ; Default path to save the log file.
    LogDefaultPath=
    ; Auto start logging with default log file name.
    LogAutoStart=on

I have modified it to include date.

Is there any way to prefix hostname in logfile name

Fox eg,

myserver01-teraterm.log
myserver02-teraterm.logfile
myserver03-teraterm.log

Romme ,

I had the same issue, and was able to solve my problem by adding &h like below;

; Default Log file name. You can specify strftime format to here. LogDefaultName=teraterm &h %d %b %y.log ; Default path to save the log file. LogDefaultPath=C:\Users\Logs ; Auto start logging with default log file name. LogAutoStart=on

> ,

https://ttssh2.osdn.jp/manual/en/menu/setup-additional.html

"Log" tab

View log editor

Specify the editor that is used for display log file

Default log file name(strftime format)

Specify default log file name. It can include a format of strftime.

&h      Host name(or empty when not connecting)
&p      TCP port number(or empty when not connecting, not TCP connection)
&u      Logon user name
%a      Abbreviated weekday name
%A      Full weekday name
%b      Abbreviated month name
%B      Full month name
%c      Date and time representation appropriate for locale
%d      Day of month as decimal number (01 - 31)
%H      Hour in 24-hour format (00 - 23)
%I      Hour in 12-hour format (01 - 12)
%j      Day of year as decimal number (001 - 366)
%m      Month as decimal number (01 - 12)
%M      Minute as decimal number (00 -  59)
%p      Current locale's A.M./P.M. indicator for 12-hour clock
%S      Second as decimal number (00 - 59)
%U      Week of year as decimal number, with Sunday as first day of week (00 - 53)
%w      Weekday as decimal number (0 - 6; Sunday is 0)
%W      Week of year as decimal number, with Monday as first day of week (00 - 53)
%x      Date representation for current locale
%X      Time representation for current locale
%y      Year without century, as decimal number (00 - 99)
%Y      Year with century, as decimal number
%z, %Z  Either the time-zone name or time zone abbreviation, depending on registry settings;
    no characters if time zone is unknown
%%      Percent sign

example:

teraterm-&h-%Y%m%d_%H_%M_%S.log

[Apr 12, 2020] logging - Change log file name of teraterm log - Stack Overflow

Apr 12, 2020 | stackoverflow.com

Change log file name of teraterm log Ask Question Asked 4 years, 8 months ago Active 10 months ago Viewed 5k times


pmverma ,

[Nov 20, 2014] Logging must be per line not per character

TeraTerm Support Forums

Post subject: Re: TeraTerm Logging must be per line not per character

Mar 07, 2012 5:26 am

Hi:
I have been using TeraTerm for last 3 years now. I am using version 4.69 currently.

I have to always log everything I do while testing the products I works on. So I turn on logging in TeraTerm.

I have one problem with TeraTerm Logging. When I mis type the command on my product and press backspace to cancel it, TeraTerm logs even that in the log file. This confuses me a lot when I go thru the logs.

I think TeraTerm must log only after user has pressed "Enter" key. This will have clean log file.

Is there anyway TeraTerm logging can be per line.. rather than per character?

Appreciate your help as this is very important issue for me.

Trevor

Guru

Joined: Wed Jul 26, 2006 4:47 am
Posts: 423
Location: UK

A lot of us certainly would not want the logging to change like this so if it were implemented it should be a configurable item.

logpause

Causes Tera Term to pause logging.

logpause

Received characters are discarded while logging is paused.

Example

prompt = '$'

cygconnect
wait prompt

; get a user name
getenv 'USERNAME' username
; get the date and time
gettime timestr "%Y%m%d-%H%M%S"

; add the user name and the timestamp to the log file name
sprintf2 filename 'd:\console_%s_%s.log' username timestr
;messagebox filename 'filename'

logopen filename 0 0
logwrite 'Log start'#13#10
sendln 'cal'
wait prompt
; Suspend logging
logpause
; The below command is not logging
sendln 'date'
wait prompt
; Resume logging
logstart
sendln 'uptime'
wait prompt
logwrite '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'#13#10
logclose

end

reading data from telnet session

TeraTerm Support Forums • View topic -

yoursprp

Post subject: reading data from telnet session

Jun 04, 2014 12:45 pm

Hi,

My telnet server is having some text which scrolling continuously, how can i copy the text to my local computer. simply how can I read server data in telnet session?

Trevor

Guru

Joined: Wed Jul 26, 2006 4:47 am
Posts: 423
Location: UK

Turn logging on maybe?
Click "File" -> "Log"

yoursprp

I got some solution

recvln
while result=1
recvln
filewriteln file inputstr
endwhile

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Top articles

Sites

logpause

Additional settings([Setup] Menu)

Log and replay functions

Logging with TeraTerm Pro - Part 1.mp4 - YouTube

TeraTerm Support Forums • View topic - reading data from telnet session



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: April, 12, 2020