Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We are developing a java web application. We'll be deploying the application in the linux server. To connect to the server we're using the putty tool.

For the local testing of the application we use our local host and use a log viewer to see the logs.

Is there are any tool to view the log files in the remote machine by using the tunneling methods in putty.

share|improve this question
add comment

migrated from stackoverflow.com Nov 2 '12 at 10:03

This question came from our site for professional and enthusiast programmers.

2 Answers

Here is how I would do it, assuming I wanted to see a log file in /var/log.

Sample: On Remote Server, going to tunnel to, using python:

cd /var/log

In that directory,

python -m SimpleHTTPServer 8080

Configure Putty [ Remote-Host-IP: Remote-Port ] x.x.x.x:8080. SSH in, Thereafter in your browser you can just type:

http://127.0.0.1:8080

All log files fully accessible.

Putting this into code is a little harder. I would suggest getting an SSH library (plenty around), or writing a remote web service which tails logs and spits out most recent updates etc. Perhaps you could issue get requests even to 'tail -n x' (x - being the number of most recent records you would want to see.

Addendum: How to Configure Tunneling

share|improve this answer
add comment

I'm using OtrosLogViewer to watch logs from remote machines in real time (log4j and JDK logging). It supports SFTP and Samba. On development environment I'm using log4j SocketHubAppender.

It's also worth to see following demo on youtube

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.