How to monitor more than one log file at a time
Is there any Java API to monitor more than one log file at a time. i.e.in 开发者_开发百科TailerListener
we are able to monitor a single log file.
Please let me know if any Java API or any simple methods to monitor more than one log file.
Take a look at JNotify. It uses the Linux inotify subsystem.
From the web page:
JNotify is a java library that allow java application to listen to file system events, such as:
- File created
- File modified
- File renamed
- File deleted
There are a couple of other inotify implementations for java out there, and this is a good article on the topic.
- inotify-java
- JFileNotify
Simply create multiple Tailer
objects using the same TailerListener
instance.
I am not sure i understand the question. what exactly are you trying to do?
and did you try using log4j? if i understand the question you can make as many different log files as you like.
精彩评论