Another follow-up:
I got rolling.RFA working with the xml-properties file and
SizeBasedTriggeringPolicy.
No luck yet with a flat properties file, but that's probably just a matter
of finding the correct syntax.

However, I noticed that rolling.RFA with a TimeBasedRollingPolicy wasn't
working either, so I figured it had the same problem as
DailyRollingFileAppender.
After further lookup, I got it working with the following change:

TimeBasedRollingPolicy.h, Ln 138:
        class LOG4CXX_EXPORT TimeBasedRollingPolicy : public
RollingPolicyBase,
             public TriggeringPolicy {
-          DECLARE_ABSTRACT_LOG4CXX_OBJECT(TimeBasedRollingPolicy)
+          DECLARE_LOG4CXX_OBJECT(TimeBasedRollingPolicy)
 
I don't know how this affects other stuff, but the DECLARE_ABSTRACT prevents
a TimeBasedRollingPolicy from being created with newInstance(). 

Just wanted to let you know...

-----Original Message-----
From: Iwan Tomlow [mailto:[EMAIL PROTECTED] 
Sent: woensdag 3 augustus 2005 9:37
To: 'Log4CXX User'
Subject: RE: Should properties file be changed after v0.9.7?


Just to let you know I at least got the DailyRollingFileAppender logging
again with the following patch:

Dailyrollingfileappender.h, Ln 50:
class DailyRollingFileAppender : public log4cxx::helpers::ObjectImpl,
Appender {
  DECLARE_LOG4CXX_OBJECT(DailyRollingFileAppender)
  BEGIN_LOG4CXX_CAST_MAP()
          LOG4CXX_CAST_ENTRY(DailyRollingFileAppender)
          LOG4CXX_CAST_ENTRY(Appender)
+           LOG4CXX_CAST_ENTRY(spi::OptionHandler)
  END_LOG4CXX_CAST_MAP()

While debugging I noticed that in PropertyConfigurator::parseAppender() this
always returned FALSE for my DailyRollingFileAppender: if
(appender->instanceof(OptionHandler::getStaticClass()))

After the patch, the options get set and the logfile is written again. Still
doesn't seem to be rolling though, neither is the RFA after trying to
configure rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy,
triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy

I'll give it a try using the xml-example, maybe my conversion to a flat
properties-file is incorrect.


-----Original Message-----
From: Iwan Tomlow [mailto:[EMAIL PROTECTED] 
Sent: woensdag 3 augustus 2005 8:38
To: 'Log4CXX User'
Subject: RE: Should properties file be changed after v0.9.7?


Hi, thanks for the quick reply!
I'll try to work out the properties-layout for the new rolling.RFA from the
log4j sources. I did notice the examples with the API-calls, but I would
really like to get it to work again with the properties-file.

Do I understand you correctly that the DailyRollingFileAppender should still
work without any changes to the properties-file, even though it is itself
defined using the new rolling.RFA?

Reply via email to