0

i want to monitor several log files concurrently .How to do in java ?

ssbecse
  • 11
  • 2
  • check out http://stackoverflow.com/questions/1096404/is-there-a-sophisticated-file-system-monitor-for-java-which-is-freeware-or-open-s – Cine May 18 '11 at 05:51
  • What do you mean by 'monitor'? – sje397 May 18 '11 at 05:58
  • 1
    with threads? However, it's not entirely clear to me what you mean by 'monitor' – MarcoS May 18 '11 at 06:09
  • if it is just monitoring the logs you want to do, then on Linux, you can use tail -f and specify all the log files you want to monitor – Codemwnci May 18 '11 at 06:26
  • possible duplicate of [in java taillistener, how to handle more log files](http://stackoverflow.com/questions/6039923/in-java-taillistener-how-to-handle-more-log-files) – Stephen C May 18 '11 at 06:34

1 Answers1

1

Hard to understand what you want to do, so I will guess :)

Use the Apache Commons IO class named Tailer to tail the files that you want to keep track of. (If reading from them is what you want to do). The javadoc for the class has examples of how to use it with threads.

Kaj
  • 10,862
  • 2
  • 33
  • 27
  • yes ..i want to display the log message when log messages are updated in log file. – ssbecse May 18 '11 at 06:33
  • Also when i am using Tailer api,i facing the following problem.please look in to this .http://stackoverflow.com/questions/6039923/in-java-taillistener-how-to-handle-more-log-files – ssbecse May 18 '11 at 06:35