google-code-export / snaketail-net

Automatically exported from code.google.com/p/snaketail-net
0 stars 1 forks source link

Ability to tail multiple logfiles with "same" filename #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello!
I have the requirement to tail multiple logfiles with similar filenames.
Example: 
"MethodServer-1311081904-2720-log4j.log" and 
"MethodServer-1311081905-5624-log4j.log" should be diplayed together but 
"MethodServer-1310170912-1764-log4j.log" not as it si outdated.
The first block "1311081904" ist the reverse-date => variable => only latest 
should be shown.
The second block "2720" is the process-id which marks a different filename.
Any idea how to realize that (maybe it exists already).
Kind regards and THX for the great tool!
Daniel

Original issue reported on code.google.com by kremer...@gmail.com on 9 Nov 2013 at 11:25

GoogleCodeExporter commented 9 years ago
Think it would be difficult to monitor these files. I would probably change the 
program so it attempts to claim a global mutex "MethodServer-N" at startup.

It tries "Global\\MethodServer-1", "Global\\MethodServer-2", 
"Global\\MethodServer-N". The program then uses the next available mutex name 
for the log file name (Can still contain process-id):

"MethodServer-N-DateTime-ProcessId-log4j.log"

Then it is a matter of setting up a monitoring of the following log files using 
wildcard:

"MethodServer-1-*"
"MethodServer-2-*"
"MethodServer-3-*"
"MethodServer-N-*"

Until you get tired, or that you believe that no more instances of MethodServer 
will be running simultaneously.

Original comment by sweaty1 on 21 Nov 2013 at 10:35