On 28/07/2015 17:58, Colin Booth wrote:
Assuming you're on linux and the output file descriptor is stable, "the right way" is to use procfs to directly read against the file descriptor that the logger is outputting to. I don't know which file descriptors tinylog uses but s6-log uses fd 4 for its file.
I'll +1 Wayne: this is in no way guaranteed. It's only true for s6-log if there's only one logdir, and up to the first rotation. It changes for every rotation - often, but not always, oscillating between 4 and 6. If you want to go the "map the current log file" route instead of the "insert hooks somewhere in the log flow" one, grepping all the links in /proc/$loggerpid/fd for /current$ sounds like a better solution - and even then it's still hackish. -- Laurent
