Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read a remote log file like a tail command.

 
ahmet oguz
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I want to write a java program that reads a remote log file like a tail command on unix.
when i run the program it connects the remote machine and read the log file like tail command. I want to read logs from log file not from the beginning of the log file, just what logs come after connecting the remote machine, only those logs read. How can i do this?
Thanks.
 
Norm Radder
Ranch Hand
Posts: 728
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do an HTTP GET to a server for a file, the whole file will be returned.
If you only want to have part of the file returned, you'll need code on the server to extract the part you want and sent that back to you.
 
ahmet oguz
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you, in fact I want to write a tail command unix with java for remote machines on remote files. So in a remote machine i write a java class for log file with rmi and then my program calls this rmi class? Can i do this with this? can anybody help me?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic