0

I am dealing with a misbehaving third-party program, the vendor of which seems happy to help if I can provide them with the debug log. They told me how to turn debug logging on and off, however somewhere within the program there's a limit on the log file of 65 KB - according to the vendor this is hardcoded. As soon as this log limit is hit, the entire log is simply deleted and a new file with the same name is created instead. As a result, only about 1 minute of debug log is saved before the log is deleted and a new one is created. Trying to tail -f the log doesn't help as when the new one is created, it's not the same file any more, so tail just stops.

The whole thing is made more complicated by the fact that the program is running on an embedded linux with absolute minimal tool support (there's no ssh or ftp even, only telnet to connect to it). There is no find command, not locate or slocate and I'm not even talking about the compilers. There's shell there - sh and ash - that's all. I'm really at a loss as to how to capture about 20 minutes of debug logging. Any suggestions would be more than appreciated.

5
  • 1
    If tail -F is supported, use that.
    – yoonix
    Jun 18, 2014 at 22:33
  • Can you see cron jobs? probably the program would have written cron job, try editing the time of it, so that you can escape the deletion
    – J Bourne
    Jun 19, 2014 at 17:24
  • @Sai The deletion occurs not by time but by the size of the log file. As soon as the log file hits 65535 bytes, it's deleted.
    – Aleks G
    Jun 19, 2014 at 21:12
  • Are you sure it is done the deletion is done by programme, or /etc/logrotate.d?
    – J Bourne
    Jun 20, 2014 at 9:13
  • @Sai there is no /etc/logrotate*. It's a very cut down version of embedded linux.
    – Aleks G
    Jun 20, 2014 at 9:16

1 Answer 1

0

You could try and make a little script that reads the log file and appends it to another file every 50 seconds approx.

If you have cat or echo it schould be realtively easy.

If you edit the question to post example names of the log file, I can help matching that in a bash script

1
  • Yeah, thanks, that's about the only thing I can think of. Of course, I'll then have to manually go through the resulting output and delete repeated records.
    – Aleks G
    Jun 19, 2014 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .