How to read the log?

 I want to know some testing code in watir. I have to read the log 

files from the server log which is showing on the Jboss server. How can
I read that and write that in the local machine. Can you give an example
code for reading that file from the server log and storing that into a
txt file in the local system. Any one knows please help me for this. It
is urgent.