Why not use a proper logging framework instead of System.out? You have at least three at your disposal:
- java.util.logging and use the RollingFileHandler from http://www.x4juli.org/
- Log4j and use DailyRollingFileAppender
- Logback and use RollingFileAppender
Using any of these you will be able to control what you log (using levels - debug, info, warn, error), where you log (turn loggers on and off) and log into different targets - files, db, mail, jms etc.
David Rabinowitz
2009-09-30 10:18:51