aspose file tools*
The moose likes I/O and Streams and the fly likes unsynchronized file reading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "unsynchronized file reading " Watch "unsynchronized file reading " New topic
Author

unsynchronized file reading

Anbarasu Ganesan
Greenhorn

Joined: Dec 10, 2006
Posts: 3
Hi,

I am using WSAD,log4j for logging.If i want to see the log, I need to stop the server, then only I can open the log file. cos the log is locked by server. is there any solution in Java to read the log file, at the same time the server is running.

Thanks in advance
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

What are you trying to use to open the log file? What OS are you using? Unix operating systems make such tasks very easy. VI, cat and tail all can be used on open files. If you are stuck with Windows try a programmer's editor like JEdit


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Anbarasu Ganesan
Greenhorn

Joined: Dec 10, 2006
Posts: 3
Thanks
my application is running in WSAD Test Environment, the log file is written in /appn/sys/logs path. I need to see the log file content.
my OS is WINXP, whenever I try to open the log file using wordpad, it displays a message, file is been using by another application. So I should stop the server then I can see the log file.
What I am looking can I open the log file while the application running? is it possible?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Wordpad is not well-suited to any programming task.
JEdit will correctly handle open files, as will probably any other full-featured editor.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unsynchronized file reading