Java application that can transfer the contents of an arbitrary file to the browser (live tail)

I searched the Internet for a while for a Java web application that can be used to tail on any arbitrary file in the file system. The most important requirement would be to have an application for streaming file changes, so I do not need to update (for example, stuff that you can easily do with node.js).

I can write quickly myself, but the requirement of streaming is not trivial. In addition, the application must be deployed to the Java application server.

Any pointer?

thanks

+2
source share
2 answers

Ok, so I followed @Liv's suggestion, and I did it myself. This is the fruit of a couple of hours of coding, so do not expect much.

I tested it on Tomcat and Jetty. Check the README file.

https://github.com/aestasit/logviewer

+6
source

I had to do this a while ago, since I could not find it. I would advise you to go down the Ajax route - since trying to launch the "tail -f ..." and grabbing its console is tedious, and because you have been connecting to the browser for a long time, you will find out that sometimes the browser simply closes the connection.

+1
source

Source: https://habr.com/ru/post/919759/


All Articles