aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes How to read a remote log file like a tail command. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to read a remote log file like a tail command." Watch "How to read a remote log file like a tail command." New topic
Author

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

ahmet oguz
Greenhorn

Joined: Mar 08, 2006
Posts: 18
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

Joined: Aug 10, 2005
Posts: 690
    
    1
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

Joined: Mar 08, 2006
Posts: 18
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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to read a remote log file like a tail command.