|
| | FixedWindowRollingPolicy () |
| | ~FixedWindowRollingPolicy () |
| void | activateOptions (helpers::Pool &p) override |
| void | setOption (const LogString &option, const LogString &value) override |
| | Set option to value.
|
| void | rollover () |
| int | getMaxIndex () const |
| int | getMinIndex () const |
| void | setMaxIndex (int newVal) |
| void | setMinIndex (int newVal) |
| RolloverDescriptionPtr | initialize (const LogString ¤tActiveFile, bool append, helpers::Pool &p) override |
| | - Deprecated
- The
pool parameter is not used and will be removed in a future version. Implement this method for now, but plan to migrate to initialize() without a helpers::Pool parameter.
|
| RolloverDescriptionPtr | rollover (const LogString ¤tActiveFile, bool append, helpers::Pool &p) override |
| | - Deprecated
- The
pool parameter is not used and will be removed in a future version. Implement this method for now, but plan to migrate to rollover() without a helpers::Pool parameter.
|
| RolloverDescriptionPtr | initialize (const LogString ¤tActiveFile, bool append) |
| | Initialize the policy and return any initial actions for rolling file appender.
|
| RolloverDescriptionPtr | rollover (const LogString ¤tActiveFile, bool append) |
| | Prepare for a rollover.
|
| | RollingPolicyBase () |
| virtual | ~RollingPolicyBase () |
| void | activateOptions (helpers::Pool &p) override |
| void | setOption (const LogString &option, const LogString &value) override |
| | Set option to value.
|
| void | setFileNamePattern (const LogString &fnp) |
| | Set file name pattern.
|
| LogString | getFileNamePattern () const |
| | Get file name pattern.
|
| bool | getCreateIntermediateDirectories () const |
| void | setCreateIntermediateDirectories (bool createIntermediate) |
| PatternConverterList | getPatternConverterList () const |
| void | activateOptions () |
| virtual | ~RollingPolicy () |
| RolloverDescriptionPtr | initialize (const LogString ¤tActiveFile, bool append) |
| | Initialize the policy and return any initial actions for rolling file appender.
|
| RolloverDescriptionPtr | rollover (const LogString ¤tActiveFile, bool append) |
| | Prepare for a rollover.
|
| Public Member Functions inherited from log4cxx::spi::OptionHandler |
| virtual | ~OptionHandler () |
| void | activateOptions () |
| virtual | ~Object () |
| virtual const helpers::Class & | getClass () const =0 |
| virtual bool | instanceof (const Class &clazz) const =0 |
| virtual const void * | cast (const Class &clazz) const =0 |
When rolling over, FixedWindowRollingPolicy renames files according to a fixed window algorithm as described below.
The ActiveFileName property, which is required, represents the name of the file where current logging output will be written. The FileNamePattern option represents the file name pattern for the archived (rolled over) log files. If present, the FileNamePattern option must include an integer token, that is the string "%i" somwhere within the pattern.
Let max and min represent the values of respectively the MaxIndex and MinIndex options. Let "foo.log" be the value of the ActiveFile option and "foo.%i.log" the value of FileNamePattern. Then, when rolling over, the file foo.max.log will be deleted, the file foo.max-1.log will be renamed as foo.max.log, the file foo.max-2.log renamed as foo.max-1.log, and so on, the file foo.min+1.log renamed as foo.min+2.log. Lastly, the active file foo.log will be renamed as foo.min.log and a new active file name foo.log will be created.
Given that this rollover algorithm requires as many file renaming operations as the window size, large window sizes are discouraged. The current implementation will automatically reduce the window size to 12 when larger values are specified by the user.