Howdy, You mean like SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD"); Date now = new Date(); String timestamp = sdf.format(now); System.out.println(timestamp + ": my message");
That will do the trick. But what are you doing writing to catalina.out? ;) Use a proper logging system, like log4j or the servlet context log provided by tomcat. Both of those will auto-timestamp for you if requested, with much lower overhead than the above. Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Søren Neigaard [mailto:[EMAIL PROTECTED] >Sent: Thursday, October 23, 2003 6:22 AM >To: '[EMAIL PROTECTED]' >Subject: How to get Tomcat to log timestamp > >Ho do I get tomcat to log a timestamp in catalina.out, just like in >Apache's >access.log? > >Is it even possible to get Tomcat to log a timestamp before any >System.out.println? > >Med venlig hilsen/Best regards >Søren Neigaard >System Architect >................................ >Mobilethink A/S >Arosgaarden >Åboulevarden 23, 4.sal >DK - 8000 Århus C >Telefon: +45 86207800 >Direct: +45 86207810 >Fax: +45 86207801 >Email: [EMAIL PROTECTED] >Web: www.mobilethink.dk >................................ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]