How to add a timestamp to each line of a logfile?@Nils You linked to the question, not a specific answer. Furthermore all those examples only appear to be working with output on stdout, which I do not have. This is getting close (needs adding a timestamp). Please also note that I updated the question.

How to add a timestamp to each line of a logfile?I tried doing that but ran into a few problems; To test whether things work, I use tail -F foo.log (is that alright or does it cause more trouble?). The program sometimes reopens the logfile. It seems like the output from tail is buffered in some way. Furthermore the program seems to freeze when reopening the logfile (it does not react to input on stdin anymore).