_logfile Issue

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Dec 2, 2008
212
2
Canada
#1
I was noticing some strange things happening with my _logfile. I have TCMD setup to log as follows:

Logs.png
I setup two TCC processes, in first I ran:

do forever (echo ------ >>%_logfile)
The first process had a PID of 19700

Yes, this TCC process is constantly feeding the logfile.

The second TCC, I ran:

echo "%@Filelock[%_logfile]"

and I would run this over and over manually and some of the results were:

"4 19700" strange, system process (PID: 4) and the first TCC (PID: 19700)
"19700" this one is okay
"4" system process
"" No process has a lock on it.​

where did the "4 " come from? I think it is the SYSTEM process which is PID 4, but "4 19700" would mean that two processes having a lock on the same file? @Filelock is also sending back two process ids, the documentation does not indicate it should be doing this.

Occasionally I would also get:

TCC: (Sys) The parameter is incorrect.
"C:\JPSoft\Logs\Commands.txt"

I got the above error when the first TCC process lost connection to the file attached to _logfile. After killing the "DO" loop on the first TCC process, If I typed :

echo %_logfile

you would get:

ECHO is off

instead of the file name attached to _logfile. I don't know why the connection was broken.
 
Dec 2, 2008
212
2
Canada
#3
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.
 
Last edited:
May 29, 2008
523
3
Groton, CT
#5
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.
I have something like this
Code:
echo Running (%_batch) %_batchname at %_date  %_time
That will go into the log file, of course, and also display it. If you don't want to display it on the screen, add
Code:
> nul
to it, or use the LOG verb instead of ECHO.

Code:
LOG Running (%_batch) %_batchname at %_date  %_time
The PID shows up in the log file entry. Here's an example:
Code:
[03-21-16 12:59:04][8140] echo Running (1) C:\Users\DCantor\Work\taskwatch1.bat at 21-Mar-2016 12:59:04 EDT