Best way to monitor a log file ?
-
Hi, I'm developing a small app in which I have to check in real time an updating log file from another program. What is the best way to do this ?
@Echiqueur
There is little detail here, so best answer may vary. Qt has the QFileSystemWatcher Class,fileChanged
signal, if you want to know when a file is modified. Or you can just open for read and reads will be satisfied when new data is available (https://stackoverflow.com/questions/2696976/implement-tail-f-in-c). Depends what you are looking for, how data is written to the file, what shared open modes it allows, etc. -
@Echiqueur
There is little detail here, so best answer may vary. Qt has the QFileSystemWatcher Class,fileChanged
signal, if you want to know when a file is modified. Or you can just open for read and reads will be satisfied when new data is available (https://stackoverflow.com/questions/2696976/implement-tail-f-in-c). Depends what you are looking for, how data is written to the file, what shared open modes it allows, etc.