Hello guys,

I am new to log4j so please bear with me. I am writing a program in java
that used to be written in C++. The C++ program used a home-grown
logger. I am trying to use log4j to do the logging. The homegrown logger
used to write 4 logfiles per day; the files were considered as watches
of a 6 hour duration (0000->0600, 0600->1200, 1200->1800 and
1800->2400). It looks to me like I might be able to use
DailyRollingFileAppender to do a similar job.

The trouble is, I do not know what DatePattern to use to get the
rollover happening every six hours starting at midnight. The watches are
absolute times, they are NOT six hours from the start of execution.

Here is my appender:

  <appender name="dailyRollFile" 
          class="org.apache.log4j.DailyRollingFileAppender">
    <param name="DatePattern" 
       value="'.'yyyy-MM-dd-a"/>
    <param name="maxLogs" value="100"/>
    <param name="File" 
       value="logs/LogFile-'yyyy-MM-dd-a'.log"/>
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" 
       value="%d{ABSOLUTE} [%20.20t] (%30.30c{3}) %-5p - %m%n"/>
    </layout>
    </appender>

The name of the file that gets created contains a literal 'yyyy-MM-dd-a'
rather than the actual date/time I expected. What am I doing wrong
please?

Finally, the program gives a warning at startup:

log4j:WARN No such property [maxLogs] in
org.apache.log4j.DailingRollingFileAppender.

What does this mean please? How can I make this problem go away?

Regards,

Andrew Marlow
----
There is an emerald here the size of a plover's egg!
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html


******************************************************************************"
The data and information (collectively called Information) herein is the sole 
property of ICAP.  The Information is confidential, may be legally privileged 
and is intended solely for the use of the individual or entity to whom it is 
addressed.  Unauthorised disclosure, copying or distribution of the Information 
is strictly prohibited and the recipient of the Information shall not 
redistribute the Information in any form to a third party.  If you received 
this Information in error please tell us by reply (or telephone the sender) and 
delete all copies on your system.

References in this Information to ICAP are references to ICAP plc, a company 
incorporated in England with registered number 3611426 whose registered office 
is 2 Broadgate, London, EC2M 7UR and where the context requires, includes its 
subsidiary and associated undertakings.  As applicable, certain companies 
within the ICAP group are authorised and regulated by the Financial Services 
Authority.  Any investment research sent from ICAP will provide an impartial 
and objective assessment of the securities, companies or other matters that are 
the subject of their research and our Conflicts of Interest Management Policy 
regarding investment research can be viewed by requesting a copy from your 
usual contact at ICAP.  Please visit www.icap.com for further regulatory 
information including details regarding the European eCommerce Directive.

*******************************************************************************"
We have taken precautions to minimise the risk of transmitting software 
viruses, but we advise you to carry out your own virus checks on any attachment 
to this message. We cannot accept liability for any loss or damage caused by 
software viruses. "
******************************************************************************* 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                     


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to