Howdy, You're doing far too much. Why are you wrapping java.util.logging.Logger? JDK 1.4 logging, like any serious logging package, will format the logs and timestamps as you specify in the logging configuration file.
Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Galbayar [mailto:[EMAIL PROTECTED] >Sent: Saturday, October 11, 2003 2:54 AM >To: Tomcat Users List >Subject: Jav.util.logging URGENT > >Hi, I am learning to use logger. I have a code snippet below > >package test >import java.io.IOException; >import java.io.Serializable; > >import java.text.SimpleDateFormat; > >import java.util.Date; >import java.util.logging.FileHandler; >import java.util.logging.SimpleFormatter; > > > >public class Logger implements Serializable { > static SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd"); > > public static void logInfo(String message) { > try { > java.util.logging.Logger logger = >java.util.logging.Logger.getLogger( > "test"); > FileHandler fh = new FileHandler("C:/ubs_" + sdf.format(new >Date()) + ".log", true); > fh.setFormatter(new SimpleFormatter()); > logger.addHandler(fh); > logger.info(message); > } catch (SecurityException e) { > e.printStackTrace(); > } catch (IOException e) { > e.printStackTrace(); > } > } >} > >after called Logger.logInfo("test") 2 times created 5 files? > >ubs_2003_10_11.log >ubs_2003_10_11.log.lck >ubs_2003_10_11.log.1 >ubs_2003_10_11.log.1.lck >ubs_2003_10_11.log.2 >ubs_2003_10_11.log.2.lck > >what's happened? i need Logger create one file? >Thanks in advance > > > >--------------------------------------------------------------------- >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]