You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Jathy <xu...@yahoo.com> on 2008/10/10 09:02:09 UTC
TimeBasedRollingPolicy does not work in RollingFileAppender
I used TimeBasedRollingPolicy to rollover log file every day but it did not
work. No files was generated. My configuration file is shown below,
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">
<appender name="ROLLING"
class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy
class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
</rollingPolicy>
<layout class="org.apache.log4j.PatternLayout">
</layout>
</appender>
<root>
<level value="info"/>
<appender-ref ref="ROLLING"/>
</root>
</log4j:configuration>
And in the code, I used the following codes to initialized the log4cxx:
string strXmlConfig = "logging.xml";
log4cxx::xml::DOMConfigurator::configure(strXmlConfig);
log4cxx::LoggerPtr pLogger = log4cxx::Logger::getRootLogger();
What's wrong about my configuration or codes? Thank you.
--
View this message in context: http://www.nabble.com/TimeBasedRollingPolicy-does-not-work-in-RollingFileAppender-tp19913027p19913027.html
Sent from the Log4cxx - Users mailing list archive at Nabble.com.
Re: TimeBasedRollingPolicy does not work in RollingFileAppender
Posted by Jathy <xu...@yahoo.com>.
Jathy wrote:
>
> I used TimeBasedRollingPolicy to rollover log file every day but it did
> not work. No files was generated. My configuration file is shown below,
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <log4j:configuration xmlns:log4j='http://logging.apache.org/'
> debug="true">
> <appender name="ROLLING"
> class="org.apache.log4j.rolling.RollingFileAppender">
> <rollingPolicy
> class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
>
>
> </rollingPolicy>
> <layout class="org.apache.log4j.PatternLayout">
>
> </layout>
>
> </appender>
> <root>
> <level value="info"/>
> <appender-ref ref="ROLLING"/>
> </root>
> </log4j:configuration>
>
> And in the code, I used the following codes to initialized the log4cxx:
>
> string strXmlConfig = "logging.xml";
> log4cxx::xml::DOMConfigurator::configure(strXmlConfig);
> log4cxx::LoggerPtr pLogger = log4cxx::Logger::getRootLogger();
>
> What's wrong about my configuration or codes? Thank you.
>
The ploblem has been fixed, thanks.
--
View this message in context: http://www.nabble.com/TimeBasedRollingPolicy-does-not-work-in-RollingFileAppender-tp19913027p19915331.html
Sent from the Log4cxx - Users mailing list archive at Nabble.com.