Top Description Fields Constructors Methods
ch.qos.logback.core.rolling

public Class RollingFileAppender<E>

extends FileAppender<E>
Class Inheritance
Static Imports
ch.qos.logback.core.CoreConstants.CODES_URL, .CoreConstants.MORE_INFO_PREFIX

RollingFileAppender extends FileAppender to back up the log files depending on RollingPolicy and TriggeringPolicy.

For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#RollingFileAppender

Authors
Heinz Richter, Ceki Gülcü

Field Summary

Modifier and TypeField and Description
private static String
pack-priv File
private static String
private static String
private static String
pack-priv RollingPolicy
pack-priv TriggeringPolicy<E>
pack-priv Lock
Inherited from ch.qos.logback.core.FileAppender:
appendCOLLISION_WITH_EARLIER_APPENDER_URLDEFAULT_BUFFER_SIZEfileName

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private boolean
private boolean
public String
getFile()

Overrides ch.qos.logback.core.FileAppender.getFile.

Returns the value of the File property.
public RollingPolicy
public TriggeringPolicy<E>
private boolean
public void
rollover()

Implemented by delegating most of the rollover work to a rolling policy.

public void
setFile(String file)

Overrides ch.qos.logback.core.FileAppender.setFile.

The File property takes a string value which should be the name of the file to append to.
public void
setRollingPolicy(RollingPolicy policy)

Sets the rolling policy.

public void
public void
start()

Overrides ch.qos.logback.core.FileAppender.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.

If the value of File is not null, then openFile is called with the values of File and Append properties.
public void
stop()

Overrides ch.qos.logback.core.FileAppender.stop.

Implements ch.qos.logback.core.spi.LifeCycle.stop.

Stop this appender instance.
protected void
subAppend(E event)

Overrides ch.qos.logback.core.OutputStreamAppender.subAppend.

This method differentiates RollingFileAppender from its super class.
Inherited from ch.qos.logback.core.FileAppender:
addErrorForCollisioncheckForFileCollisionInPreviousFileAppendersisAppendisPrudentopenFilerawFilePropertysetAppendsetBufferSizesetPrudentwriteOut

Field Detail

COLLISION_URLback to summary
private static String COLLISION_URL
currentlyActiveFileback to summary
pack-priv File currentlyActiveFile
RFA_LATE_FILE_URLback to summary
private static String RFA_LATE_FILE_URL
RFA_NO_RP_URLback to summary
private static String RFA_NO_RP_URL
RFA_NO_TP_URLback to summary
private static String RFA_NO_TP_URL
rollingPolicyback to summary
pack-priv RollingPolicy rollingPolicy
triggeringPolicyback to summary
pack-priv TriggeringPolicy<E> triggeringPolicy
triggeringPolicyLockback to summary
pack-priv Lock triggeringPolicyLock

Constructor Detail

RollingFileAppenderback to summary
public RollingFileAppender()

Method Detail

attemptOpenFileback to summary
private void attemptOpenFile()
attemptRolloverback to summary
private void attemptRollover()
checkForCollisionsInPreviousRollingFileAppendersback to summary
private boolean checkForCollisionsInPreviousRollingFileAppenders()
checkForFileAndPatternCollisionsback to summary
private boolean checkForFileAndPatternCollisions()
getFileback to summary
public String getFile()

Overrides ch.qos.logback.core.FileAppender.getFile.

Doc from ch.qos.logback.core.FileAppender.getFile.

Returns the value of the File property.

This method may be overridden by derived classes.

Annotations
@Override
getRollingPolicyback to summary
public RollingPolicy getRollingPolicy()
getTriggeringPolicyback to summary
public TriggeringPolicy<E> getTriggeringPolicy()
innerCheckForFileNamePatternCollisionInPreviousRFAback to summary
private boolean innerCheckForFileNamePatternCollisionInPreviousRFA(FileNamePattern fileNamePattern)
rolloverback to summary
public void rollover()

Implemented by delegating most of the rollover work to a rolling policy.

setFileback to summary
public void setFile(String file)

Overrides ch.qos.logback.core.FileAppender.setFile.

Doc from ch.qos.logback.core.FileAppender.setFile.

The File property takes a string value which should be the name of the file to append to.

Annotations
@Override
setRollingPolicyback to summary
public void setRollingPolicy(RollingPolicy policy)

Sets the rolling policy. In case the 'policy' argument also implements TriggeringPolicy, then the triggering policy for this appender is automatically set to be the policy argument.

Annotations
@SuppressWarnings:unchecked
setTriggeringPolicyback to summary
public void setTriggeringPolicy(TriggeringPolicy<E> policy)
startback to summary
public void start()

Overrides ch.qos.logback.core.FileAppender.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.

Doc from ch.qos.logback.core.FileAppender.start.

If the value of File is not null, then openFile is called with the values of File and Append properties.

stopback to summary
public void stop()

Overrides ch.qos.logback.core.FileAppender.stop.

Implements ch.qos.logback.core.spi.LifeCycle.stop.

Doc from ch.qos.logback.core.OutputStreamAppender.stop.

Stop this appender instance. The underlying stream or writer is also closed.

Stopped appenders cannot be reused.

Annotations
@Override
subAppendback to summary
protected void subAppend(E event)

Overrides ch.qos.logback.core.OutputStreamAppender.subAppend.

This method differentiates RollingFileAppender from its super class.

Annotations
@Override