On Wed, 16 Mar 2005, Jonathan Manning wrote:
> I wanted to set a DateFormat to match the default Apache Log format -
> ie: [Wed Mar 16 16:51:13 2005] [notice] Apache/2.0.52 ...
>
> This will help Log4perl messages from my mod_perl app blend in with the
> rest of the server log.
>
> But the 3 digit forms for Weekday and Month don't seem to work.
>
> ( As a side note, the docs say:
> DATE "dd MMM yyyy HH:mm:ss,SSS" "06 Nov 1994 15:49:37,459"
> While using that format 'Nov' actually appears with the full month name... )
Think you're right.
> Based on the log4j description (but not the examples) I think it should be:
> E = W
> EE = We
> EEE = Wed
> EEEE+ = Wednesday
Not sure about this one, though. In
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html
it just says that an abbreviated form is used if it's available, I can't find
any reference
that E=W and EE=We. Isn't it E=Wed and EE=Wed instead?
If we can clarify this, I'll apply your patch in 0.52. Thanks!
-- Mike
Mike Schilli
m@xxxxxxxxxxxxxxx
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|