Hi all,

        apologies in advance if I'm being ignorant, as I'm new to this...

        I'm using log4cxx on Windows and trying to use PatternLayout to control 
the formatting of dates. Previously I was using log4cxx 0.9.7 and log4cxx 
0.10.0 with visual c++ 7.1 and patterns such as %d{%d %b %Y %H:%M:%S:%Q} were 
working as expected (this one generates 29 Jan 2009 11:22:04:026).

        Recently I have been trying to use log4cxx 0.10.0 with visual c++ 9.0 
and encountering https://issues.apache.org/jira/browse/LOGCXX-308. So I went to 
the documentation for the PatternLayout at 
http://logging.apache.org/log4cxx/apidocs/index.html and found this about the 
%d conversion character:


Used to output the date of the logging event. The date conversion specifier may 
be followed by a set of braces containing a date and time pattern string 
compatible with java.text.SimpleDateFormat, ABSOLUTE, DATE or ISO8601. For 
example, d{HH:mm:ss,SSS}, d{dd MMM yyyy HH:mm:ss,SSS} or d{DATE}. If no date 
format specifier is given then ISO8601 format is assumed.

This is very different from what worked before so I decided to test it (in 
log4cxx 0.10.0 and vc 7.1) and got the following results:

        Pattern                         Output

        %d{ISO8601}                             2009-01-29 11:23:38,073
        %d{ABSOLUTE}                    11:22:59,136
        %d{DATE}                                29 Jan 2009 11:19:11,448
        %d{HH:mm:ss,SSS}                        HH:mm:ss,SSS
        %d{dd MMM yyyy HH:mm:ss,SSS}    dd MMM yyyy HH:mm:ss,SSS

        Can anyone advise as to why the last two aren't giving the results 
expected? What I'm doing wrong? To be honest, either ISO8601 or DATE will be 
fine for us but I'm just puzzled as to why I can't get the last two working.

        With many thanks,

                Ben Nasatyr




***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered 
Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The 
Royal Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
Visit our websites at: 
www.rbs.com
www.rbs.com/gbm
www.rbsgc.com
***********************************************************************************

Reply via email to