Wong-
SimpleDateFormat is not a attribute in java.util.logging.ConsoleHandler
http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/ConsoleHandler.html
but org.apache.commons.logging.impl.SimpleLog contains the datetime attributes
you seek
org.apache.commons.logging.simplelog.showdatetime -
Set to true if you want the current date and time
to be included in output messages. Default is
false.org.apache.commons.logging.simplelog.dateTimeFormat -
The date and time format to be used in the output messages.
The pattern describing the date and time format is the same that is
used in java.text.SimpleDateFormat. If the format is not
specified or is invalid, the default format is used.
The default format is yyyy/MM/dd HH:mm:ss:SSS zzz.
please refer to commons-logging JavaDocs for operational specifics
http://commons.apache.org/logging/apidocs/index.html
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission.
> Date: Thu, 19 Feb 2009 08:51:36 -0800
> From: [email protected]
> Subject: Re: convert date from Feb 18, 2009 8:56:27 PM to 2009-02-18 20:56:27
> To: [email protected]
>
>
> --- On Thu, 2/19/09, Christopher Schultz <[email protected]> wrote:
>
> > From: Christopher Schultz <[email protected]>
> > Subject: Re: convert date from Feb 18, 2009 8:56:27 PM to 2009-02-18
> > 20:56:27
> > To: "Tomcat Users List" <[email protected]>
> > Received: Thursday, February 19, 2009, 10:27 AM
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > PoWah,
> >
> > On 2/19/2009 8:14 AM, PoWah Wong wrote:
> > > The /usr/tomcat/logs/catalina.out file has these
> > entries:
> > > Feb 18, 2009 8:56:27 PM
> > org.apache.coyote.http11.Http11AprProtocol start
> > > INFO: Starting Coyote HTTP/1.1 on http-8443
> > > Feb 18, 2009 8:56:27 PM
> > org.apache.catalina.startup.Catalina start
> > > INFO: Server startup in 2377 ms
> >
> > Are these the only log messages with this date format? How
> > about others?
> > I ask because it's possible that these specific log
> > messages have the
> > date format hard-coded into them.
> >
> > > How to convert date from Feb 18, 2009 8:56:27 PM to
> > 2009-02-18 20:56:27?
> > >
> > > I set the files
> > > /opt/axis2-1.2/webapp/WEB-INF/classes/log4j.properties
> > >
> > /usr/local/apache-tomcat-6.0.10/webapps/xmc/WEB-INF/classes/log4j.properties
> >
> > This configures log4j for your application, and does not
> > affect Tomcat.
> > You need to modify CATALINA_BASE/conf/logging.properties in
> > order to
> > affect Tomcat's logging.
> >
> > http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> >
> > - -chris
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (MingW32)
> > Comment: Using GnuPG with Mozilla -
> > http://enigmail.mozdev.org
> >
> > iEYEARECAAYFAkmdekkACgkQ9CaO5/Lv0PB6fACfRbZe/wpTGjySUQaJ04+tyEWE
> > bFoAn1uFEHUgKcP8qwmhKiXmBM9eXFaR
> > =yZ08
> > -----END PGP SIGNATURE-----
> >
>
> I tried the following two values for the file
> /usr/tomcat/conf/logging.properties, restarting tomcat does not fix the date
> format problem.
>
> 1.
> ...
> java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
> java.util.logging.ConsoleHandler.SimpleDateFormat = "yyyy-MM-dd HH:mm:ss"
> ...
>
> 2.
> ...
> java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
> java.util.logging.ConsoleHandler.SimpleDateFormat = yyyy-MM-dd HH:mm:ss
> ...
>
>
>
> __________________________________________________________________
> Be smarter than spam. See how smart SpamGuard is at giving junk email the
> boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to
> New Mail today or register for free at http://mail.yahoo.ca
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/