I have a piece of software that rotates its log files when it restarts. However, during development, I am restarting it a lot, so I would like to monitor the latest log file at any time.
If I start less
normally with less program.log
and hit Shift+f to tail, when the log file is rotated, I carry on monitoring the old log file. I assume this is because the inode number stays the same and less
has an open file handle to that inode.
Is it possible to monitor the latest activity on whatever log file is currently called program.log
?
Specifically, I am working on Sun OS, so a solution that works there would be ideal.
tail -F program.log | less
will work – sendmoreinfo May 01 '13 at 08:09tail -f program.log
have you tried this ? – Rahul Patil May 01 '13 at 08:13