File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Redirect to log? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "Redirect to log?" Watch "Redirect to log?" New topic
Author

Redirect to log?

sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
I am starting my ppp dialer using
wvdial isp > /var/log/ppp.log &
but it still doesn't seem to redirect output to the log file and any time I close the terminal the daemon dies???


_ __________________ _ <br />RHCE<br />SCJP<br />??:-(
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7231

This line redirects the standard output file to the file you named instead of the screen. Your program is probably sending output to the standard error file, also the screen by default. You could illustrate this difference in your command line by showing the descriptor number standard output is know by (1):

To make sure that both standard output and error write to the log, use this:

Here the shell is told to send data passed through the standard error descriptor (or "2" for short here) to the same location as 1, which is /var/log/ppp.log.
Putting a process in the background does not mean the program will run if you log out. To do that, use the nohup command, like this:

As you log out, your shell might complain that processes are running, but that's just a warning that you're leaving something unattended.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
 
subject: Redirect to log?
 
Threads others viewed
Java Logging
Redirecting Exceptions Or Exceptions to our own log files
redirect log to two different File of same class
Proper session timeout redirect
Eclipse / MyEclipse - Logging console output ?
developer file tools