RollingFileAppender
extends log4cxx::FileAppender to backup the log files depending on RollingPolicy and TriggeringPolicy.
More...
Inherits log4cxx::rolling::RollingFileAppenderSkeleton.
Classes | |
class | ClazzRollingFileAppender |
Public Member Functions | |
virtual const helpers::Class & | getClass () const |
const void * | cast (const helpers::Class &clazz) const |
bool | instanceof (const helpers::Class &clazz) const |
RollingFileAppender () | |
Static Public Member Functions | |
static const helpers::Class & | getStaticClass () |
static const log4cxx::helpers::ClassRegistration & | registerClass () |
RollingFileAppender
extends log4cxx::FileAppender to backup the log files depending on RollingPolicy and TriggeringPolicy.
To be of any use, a RollingFileAppender
instance must have both a RollingPolicy
and a TriggeringPolicy
set up. However, if its RollingPolicy
also implements the TriggeringPolicy
interface, then only the former needs to be set up. For example, TimeBasedRollingPolicy acts both as a RollingPolicy
and a TriggeringPolicy
.
RollingFileAppender
can be configured programattically or using log4cxx::xml::DOMConfigurator. Here is a sample configration file:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration>
<log4j:configuration debug="true">
<appender name="ROLL" class="org.apache.log4j.rolling.RollingFileAppender"> <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"> <param name="FileNamePattern" value="/wombat/foo.%d{yyyy-MM}.gz"/> </rollingPolicy>
<layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%c{1} - %m%n"/> </layout> </appender>
<root"> <appender-ref ref="ROLL/> </root>
</log4j:configuration>
This configuration file specifies a monthly rollover schedule including automatic compression of the archived files. See TimeBasedRollingPolicy for more details.
const void* cast | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Reimplemented from RollingFileAppenderSkeleton.
virtual const helpers::Class& getClass | ( | ) | const [virtual] |
Reimplemented from RollingFileAppenderSkeleton.
static const helpers::Class& getStaticClass | ( | ) | [static] |
Reimplemented from RollingFileAppenderSkeleton.
bool instanceof | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Reimplemented from RollingFileAppenderSkeleton.
static const log4cxx::helpers::ClassRegistration& registerClass | ( | ) | [static] |
Reimplemented from RollingFileAppenderSkeleton.