File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Logging in the Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Logging in the Application" Watch "Logging in the Application" New topic

Logging in the Application

venkat dandamudi

Joined: Sep 18, 2005
Posts: 2
I have an application which is deployed in a Jetty server. The application is working properly. The problem is, we did not log the debug statements during development. now we have around 400 java files in which there are hundreds of println statements and i need to log them in a log file using java.util.logging.
The only solution as i understand is to define a handler for each and every java file and convert the debug(println) statements into logging statements, which is any way time consuming.

could any one suggest a better way of doing this.
I mean is there any tool which we can plug-in to the Jetty server which can log all the debug statements into a log file.

It will be really helpful for me, if anyone suggests a better way to handle this problem.

Jim Cheng

Joined: Dec 08, 2004
Posts: 11
I am not familiar with the plug-in.

One hack that you could try is to Reassigns the "standard" output stream.
Check System.setOut(PrintStream out) to re-direct the output to a log file.

However, I would still suggest to change the code (e.g., System.out.println()) to use logging API.
I agree. Here's the link:
subject: Logging in the Application
It's not a secret anymore!