Menu

Serious problem with logging intervals

Help
George
2009-11-02
2013-05-28
  • George

    George - 2009-11-02

    This program works fine when the log intervals are disable.

    However, I'm having serious problems with logging the recorded keystrokes when the log rotation interval is set to short values.

    I am setting the the log rotation to 0.03 (which is about 2 minutes), and the log flush cache to 10 seconds. Also, all screen capture features were disabled. The program is then placed into a portable thumb disk.

    This should result in a portable backup solution that I can take with me wherever I go, by just inserting the thumb drive and running the program, and when I am done, I can just unplug the drive and go without worrying about losing any data. I believe that this should back up all my input up to at most 5 minutes before I unplugged the drive.

    In order to test this, I ran the program (with the above settings) then waited about half a minute to make sure it was up and running. After that, I typed "testing testing 123 123", I then waited for 30 minutes and unplugged the thumb drive.

    What I should be seeing is the log of "testing testing 123 123" around the time I typed the input in. I do see many log files, but they are mostly empty and there is no log of "testing testing 123 123". Sometimes there is an incomplete log (e.g. "ting 123 123")

    The interesting thing is that when I log off the computer BEFORE unplugging the drive, I get a log at the right time, but it is incomplete and shows only "testing tes", and strangely enough when I go to the last log (which is about 30 minutes later) I see "ting 123 123".

    I am not sure what's going on, but it seems like the program is not properly saving the logs in real time, and maybe only saving the full log when it is closing. The abrupt removable of the thumb drive is preventing logs that should have been saved many minutes ago from being saved.

    I hope you can understand the problem I was describing, sorry for the long post.

    This is a great program, and it would be awesome if you could fix this problem, or let me know if I am doing anything wrong.

    Thanks!

     
  • nanotube

    nanotube - 2009-11-02

    Hi
    Thanks for your detailed report!
    I'll look into it and let you know.

     
  • nanotube

    nanotube - 2009-11-17

    Hi

    Well, the thing is, the log writer takes actions on every key event.

    It also accumulates the characters in a buffer until the minute changes, or until the active application changes.

    So, if you type something in one app within 1 minute, then don't have any activity (regardless of how long the delay), and pull out the disk, then your activity won't get logged.

    This /is/ a failing of the log writing algorithm - i'll try putting in a fix into the git repo for it, and give you a holler when it's ready for a testing.

    Sorry for the delay in getting back to you - been busy with other stuff…

     
  • nanotube

    nanotube - 2009-11-17

    Hi,

    I have fixed this bug, so that now the data gets written out to the file after the minute rolls over, even if there's no further user activity.

    Please check out the latest code from the git repository, and give it a testing, to see if it does what you expect.

    Note that there is still a small window of data loss, if you type something at the beginning of a minute, and then do nothing, it won't get written to disk until the end of the minute. So if you take out the usb stick before then, you lose that bit of data.

     
  • chika tambun

    chika tambun - 2009-11-17

    can u gimme the guideline to get your sourcecode works without gui…
    i'm fan of terminal mode…

    tx in advance

     

Log in to post a comment.