ch.qos.logback.core.rolling

## Class SizeBasedTriggeringPolicy<E>

- java.lang.Object
- - ch.qos.logback.core.spi.ContextAwareBase
  - - ch.qos.logback.core.rolling.TriggeringPolicyBase<E>
    - - ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy<E>

All Implemented Interfaces:
  TriggeringPolicy<E>, ContextAware, LifeCycle

    public class SizeBasedTriggeringPolicy<E>
    extends TriggeringPolicyBase<E>

SizeBasedTriggeringPolicy looks at size of the file being currently written to. If it grows bigger than the specified size, the FileAppender using the SizeBasedTriggeringPolicy rolls the file and creates a new one. For more information about this policy, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#SizeBasedTriggeringPolicy

Author:
  Ceki Gülcü

### Field Summary

Fields
`static long` `DEFAULT_MAX_FILE_SIZE` The default maximum file size.
`static java.lang.String` `SEE_SIZE_FORMAT`

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

### Constructor Summary

Constructors
Constructor and Description
`SizeBasedTriggeringPolicy()`
`SizeBasedTriggeringPolicy(java.lang.String maxFileSize)`

### Method Summary

Methods
`java.lang.String` `getMaxFileSize()`
`boolean` `isTriggeringEvent(java.io.File activeFile, E event)` Should roll-over be triggered at this time?
`void` `setMaxFileSize(java.lang.String maxFileSize)`

### Methods inherited from class ch.qos.logback.core.rolling.TriggeringPolicyBase

`isStarted, start, stop`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SEE_SIZE_FORMAT

    public static final java.lang.String SEE_SIZE_FORMAT

See Also:
  Constant Field Values

#### DEFAULT_MAX_FILE_SIZE

    public static final long DEFAULT_MAX_FILE_SIZE

The default maximum file size.

See Also:
  Constant Field Values

### Constructor Detail

#### SizeBasedTriggeringPolicy

    public SizeBasedTriggeringPolicy()

#### SizeBasedTriggeringPolicy

    public SizeBasedTriggeringPolicy(java.lang.String maxFileSize)

### Method Detail

#### isTriggeringEvent

    public boolean isTriggeringEvent(java.io.File activeFile,
                            E event)

Description copied from interface: `TriggeringPolicy`
Should roll-over be triggered at this time?

Parameters:
  `activeFile` - A reference to the currently active log file.
  `event` - A reference to the currently event.
Returns:
  true if a roll-over should occur.

#### getMaxFileSize

    public java.lang.String getMaxFileSize()

#### setMaxFileSize

    public void setMaxFileSize(java.lang.String maxFileSize)