LOG file rotation -- only recent events; 'replay'

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

I have the following logging settings enabled:

Code: Select all

    LogFile=%TEMP%\totalcmd.log
    LogOptions=7263
    LogRotateLimit=10000
    LogKeepCount=30
I am using TC since I am on this machine, for 2 1/2 years.
There is only one totalcmd.log - file in my temp directory (c:\Users\sebadru\AppData\Local\Temp\totalcmd.log), of some 3 MB, and the oldest entry is from 2019-06-08 -- just over a week ago.
Any clue where all the previous log information went?
I remember that years ago, on another machine, there were indeed a number of older log-files created, and they had numbers for the backup files. Now I search for "totalcmd*.*" on the entire machine and only find this one recent log-file. Is it possible that the rotation with up to XX backups is not working properly anymore?

In this context, I am planning to write a skript that 'replays' logged file operations on other drives. Is somebody aware of a similar existing tool? Is there a complete description of the form of all events as logged in the LOG-file?

Thanks a lot in advance for any help!
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: LOG file rotation -- only recent events; 'replay'

Post by *Stefan2 »

2sebadru

By any change, do you happen to have a "Configuration >> Options..." menu entry with your Total Commander?






 
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

Hi Stefan, thanks for taking this up.

Do I understand you correctly that you want to know the configuration I am using?
I thought I had provided that information by citing the relevant parts of the config file.

Here a screenshot of the configuration I was using over the last years:
Image: https://www.dropbox.com/s/mi10kt0jt1xubic/2019-06-19_081123.png

Or I am not getting your point...

Thanks again!
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: LOG file rotation -- only recent events; 'replay'

Post by *Stefan2 »

Hi sebadru

sebadru wrote: 2019-06-17, 23:28 UTC I have the following logging settings enabled:

Code: Select all

    LogFile=%TEMP%\totalcmd.log
    LogOptions=7263
    LogRotateLimit=10000
    LogKeepCount=30
I am using TC since I am on this machine, for 2 1/2 years.
There is only one totalcmd.log - file in my temp directory ... of some 3 MB

I remember that .... there were indeed a number of older log-files created, and they had numbers for the backup files.


OK, so you have found that configuration and set it to keep log files copies.
("Configuration >> Options... >> Log file >> Keep a maximun of [ 99 ] log files copies")


And now you say you have only one log file in your %temp%-folder?



Hm, the option "When the log files becomes larger than [ 10000] kByte ....> are ~ 10 MB equivalent,
... so you should still be good with that one log file, as it is far to small for to rotate yet ("...of some 3 MB...").


Try to change that setting to rotate "Every day after midnight" for to see that that features is working correctly.
Or set kByte to 2000 or like that.




HTH? :D
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

Dear Stefan,

I am sorry, but did you actually read my original post?? Or have I been so hard to understand? I feel you are not reacting to my points at all.

As I tried to say, yes, I have configured the logging years ago, and so there should be several log-files, as I have been using TC (with that configuration) for years. But I find only one log-file, with the FIRST (oldest) entry being from only 2 weeks back. So where is all the earlier log information? It should be in earlier log-files (up to 30), but they do not exist.

I suspect that when the file grows over 10MB (which should have happened several times, as I am copying whole archives with thousands of files for back-up regularly), instead of creating a (numbered) back-up of the log-file, as should happen with that configuration, the earlier log-file is just deleted and a new one is begun. That would be a bug. But I do not know, that's why I ask.

Thanks again for your time, I appreciate it.

Sebastian
User avatar
norfie²
Power Member
Power Member
Posts: 986
Joined: 2006-02-10, 07:27 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *norfie² »

So where is all the earlier log information?
Maybe deleted by an other program which cleans %temp% directory?
"War is evil, in so far as it makes more bad people than it takes away."
Immanuel Kant in "Perpetual Peace"
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

No, I have zillions of other files there, some from years ago, and I never visited that directory to delete anything.
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: LOG file rotation -- only recent events; 'replay'

Post by *Stefan2 »

sebadru wrote: 2019-06-19, 14:34 UTC ... I have configured the logging years ago, and so there should be several log-files, as I have been using TC (with that configuration) for years.
But I find only one log-file, with the FIRST (oldest) entry being from only 2 weeks back.
So where is all the earlier log information? It should be in earlier log-files (up to 30), but they do not exist.
...
That is your main point? Where are the old log files gone that must be exist?

We can't know what happens on your PC, but you can test as suggested.
Just set the threshold to lets say 2000 and copy a few thousand files back and forth (or wait a week or two) and see if the rotation work.

"Every day ..." for example works for me.

Code: Select all

LogFile=%TEMP%\totalcmd.log
LogKeepCount=30
LogOptions=7199
LogRotateLimit=-1


Also tell us your TC version and the used OS. Do you use this on a private or a company PC?


Also you can move the log location to another folder to be save from clean-up tools:
LogFile=%Commander_Path%\LOGs\totalcmd.log







Ahh, I forget rule No.1 (search the forum first):
OldNorton wrote: 2019-06-06, 20:30 UTC TC Log Operations and SFTP Plugin
by *OldNorton » Thu Jun 06, 2019 22:30

Logging of operations on the local computer seems to stop under certain circumstances until TC is restarted.

Using the latest TC in 64-bit together with the latest SFTP plugin (released today) I found out that logging of operations stops until TC is restarted whenever I log into an SFTP server to do writing/deleting of files or directories there. Curiously enough, if I log on the SFTP server but I do not do any write or delete operations, only log in then disconnect, logging of operations in TC continues as usual. Is this a bug or do I need to change a setting somewhere?
viewtopic.php?f=3&t=52917&p=356259&hilit=log+file#p356259


Maybe there is really a problem? But we can only know for sure if sebadru did some tests and tell us his set up.




 
User avatar
norfie²
Power Member
Power Member
Posts: 986
Joined: 2006-02-10, 07:27 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *norfie² »

Ok. I use logfile rotation with every day option. It works like a charm. Do you use TCmd version 9.22a? (AFAIR there was a problem with an older version.)

If there are shadow copies of the temp directory then you could see what was in the past.
"War is evil, in so far as it makes more bad people than it takes away."
Immanuel Kant in "Perpetual Peace"
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

Thanks Stefan and norfie² for your time and good suggestions.

Yes, my point is where the previous LOG-files have gone, which should exist.

I am using a Windows 10 home machine, 64bit, and TC 9.0a, 64bit. Its my private Laptop.

I searched in the Recycle bin, and I searched deleted files with the TC Back2Life-Plugin, and did not find any traces.

I have never used (S)FTP, so that should not be the cause.

Now, I tested with a 1MB limit (obviously a good idea, I should have done that before), and it worked allright: at the first action, the previous 3MB LOG-file was renamed to totalcmd.1.log, and a new log file was started.

So now I guess something else happened, not a TC bug -- perhaps indeed some automatic cleaning routine or similiar (although no traces among deleted files), and I will follow the advice to choose another directory in the config, outside %temp%, to prevent any such cleaning routines to delete these files, if that was the problem.

Thanks again for your valuable time and suggestions!

Sebastian
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: LOG file rotation -- only recent events; 'replay'

Post by *Stefan2 »

sebadru wrote: 2019-06-19, 21:44 UTC I am using a Windows 10 home machine, 64bit, and TC 9.0a, 64bit. Its my private Laptop.
TC 9.0a is from 2016
Win10 from 2015

So TC 9.0a didn't know many from bugs of young w10.

In the meantime there were 7 new TC releases.
Updates are free and can just overwrite older TC-files (but take care if you have modified TC-files yourself, make a backup first just in case)
9.22a >> viewtopic.php?f=3&t=52202







 
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: LOG file rotation -- only recent events; 'replay'

Post by *petermad »

License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
sebadru
Junior Member
Junior Member
Posts: 7
Joined: 2019-06-17, 23:08 UTC

Re: LOG file rotation -- only recent events; 'replay'

Post by *sebadru »

Thanks again for all the good advice. Indeed, I havn't updated TC in quite a while... My Windows is always up-to-date, though.

And yes, sure, backup -- backup -- backup, that's what I preach when I teach as well. That's why I want to create that 'replay' functionality so that you can easier compare your backups with the current state of your filesystem.
Post Reply