You can use a logging library such as
log4j from the apache software foundation.
If you decide to use this, a good idea is to get
chainsaw also. The idea is to display the logging messages from log4j in a user-friendly interface as chainsaw.
More pointers :
- for each class use it's own logging object :
class MyClass {
static final private Logger logger = Logger.getInstance(MyClass.class);
[ ... code ... ]
}
- how to configure logger in the "log4j.properties" file for your project :
log4j.rootLogger=TRACE, Chainsaw
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.layout=org.apache.log4j.PatternLayout
log4j.appender.Chainsaw.layout.ConversionPattern=%M - %L %n%m
#log4j.appender.Chainsaw.RemoteHost=localhost
log4j.appender.Chainsaw.RemoteHost=192.168.0.26
log4j.appender.Chainsaw.Port=4445
log4j.appender.Chainsaw.LocationInfo=true
Works like a charm