| | |
Want to remove debug information
![]() |
You can't, and you don't want to.
Once your application ships you want to be able to get some logs when there's a problem at a customer's site.
To get that build your application to log those messages to some file.
If you create a logger with different logging levels you can turn on different levels of logging at runtime by changing a config file or command line option.
Java has (from 1.4 onwards) a quite comprehensive logging framework built in, or you can use a 3rd party framework like Log4J.
Logfiles should at the minimum list a timestamp with every entry so you can trace what happened where, and best also a very good indication of where the entry was created (just using this.toString() is a good start, line numbers can help as well).
Once your application ships you want to be able to get some logs when there's a problem at a customer's site.
To get that build your application to log those messages to some file.
If you create a logger with different logging levels you can turn on different levels of logging at runtime by changing a config file or command line option.
Java has (from 1.4 onwards) a quite comprehensive logging framework built in, or you can use a 3rd party framework like Log4J.
Logfiles should at the minimum list a timestamp with every entry so you can trace what happened where, and best also a very good indication of where the entry was created (just using this.toString() is a good start, line numbers can help as well).
•
•
Join Date: Nov 2004
Posts: 189
Reputation:
Solved Threads: 0
Thanks jwenting,
Your reply is very helpful. I have learned so much dealing with log from you. Can you recommend some online resources to learn log related topics?
regards,
George
•
•
•
•
Originally Posted by jwenting
You can't, and you don't want to.
Once your application ships you want to be able to get some logs when there's a problem at a customer's site.
To get that build your application to log those messages to some file.
If you create a logger with different logging levels you can turn on different levels of logging at runtime by changing a config file or command line option.
Java has (from 1.4 onwards) a quite comprehensive logging framework built in, or you can use a 3rd party framework like Log4J.
Logfiles should at the minimum list a timestamp with every entry so you can trace what happened where, and best also a very good indication of where the entry was created (just using this.toString() is a good start, line numbers can help as well).
regards,
George
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
•
•
•
•
Originally Posted by George2
Thanks server_crash,
I am wondering how you debug your applications since you do not use log utility.
regards,
George
•
•
Join Date: Nov 2004
Posts: 189
Reputation:
Solved Threads: 0
Thanks for providing information server_crash,
regards,
George
•
•
•
•
Originally Posted by server_crash
lol I never really did. Sometimes I used System.out.println()'s, and sometimes I just knew what to do from the error. I've never really created anything so big, that it require a lot of debugging. But, my text editor I'm working on right now is in need of it. So I might have to put it to some use.
regards,
George
![]() |
Other Threads in the Java Forum
- Previous Thread: Looking for sound solution for J2ME.
- Next Thread: Help with a Calendar!!
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress input integer intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle physics plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree trolltech unlimited utility webservices windows






