Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.common.logging
Class IfsFileRotationHandler

    java.lang.Object
      java.util.logging.Handler
          java.util.logging.StreamHandler
              oracle.ifs.common.logging.IfsFileRotationHandler

Direct Known Subclasses:
  IfsFileHandler

    public abstract class IfsFileRotationHandler

extends java.util.logging.StreamHandler

Abstract File Handler class for log handlers that want file rotation based on file size and/or duration. Subclasses must implement the open() method.

Nested Class Summary
`protected class` | `IfsFileRotationHandler.MeteredStream` Wrap an output stream and count the number of bytes written

Field Summary
`protected java.io.File` | `m_CurrentLogFile`

Constructor Summary
`IfsFileRotationHandler()`

Method Summary
`protected IfsFileRotationHandler.MeteredStream` | `buildMeteredStream(java.io.OutputStream out, int written)` Build a stream that counts bytes written.
`protected void` | `checkFileRotation()` Check if the file size limit is reached and rotate if so.
`protected abstract void` | `open(java.io.File logFile)` Open the log file.
`void` | `publish(java.util.logging.LogRecord logRecord)` Format and publish a Log request
`protected void` | `setupRotationLogging(java.lang.String logFilePath, int fileSizeLimit, int maxNumberFiles, long rotationMillis)` Set up logging to rotate through a set of files.
`void` | `startTimeBasedRotation()` Begin time-based rotation.

Methods inherited from class java.util.logging.StreamHandler
`close, flush, isLoggable, setEncoding, setOutputStream`

Methods inherited from class java.util.logging.Handler
`getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_CurrentLogFile

    protected java.io.File m_CurrentLogFile

Constructor Detail

### IfsFileRotationHandler

    public IfsFileRotationHandler()

Method Detail

### open

    protected abstract void open(java.io.File logFile)
                          throws java.io.IOException

  Description copied from class: `IfsFileRotationHandler`
  Open the log file.

  Parameters:
    `logFile` - a File object holding the location of the logfile.
  Throws:
    `java.io.IOException` - if the operation fails

### setupRotationLogging

    protected void setupRotationLogging(java.lang.String logFilePath,
                                        int fileSizeLimit,
                                        int maxNumberFiles,
                                        long rotationMillis)

  Description copied from class: `IfsFileRotationHandler`
  Set up logging to rotate through a set of files. This will rotate based on file size and duration.

  Parameters:
    `logFilePath` - a String containing the path to the current log file.
    `fileSizeLimit` - an int containing the max size in bytes that a file will grow to before rotating.
    `maxNumberFiles` - an int containing the number of files to rotate through.
    `rotationMillis` - a long containing the number of milliseconds between rotations.

### publish

    public void publish(java.util.logging.LogRecord logRecord)

  Description copied from class: `IfsFileRotationHandler`
  Format and publish a Log request

  Overrides:
    `publish` in class `java.util.logging.StreamHandler`
  Parameters:
    `logRecord` - a LogRecord holding the log request

### startTimeBasedRotation

    public void startTimeBasedRotation()

  Description copied from class: `IfsFileRotationHandler`
  Begin time-based rotation.

### buildMeteredStream

    protected IfsFileRotationHandler.MeteredStream buildMeteredStream(java.io.OutputStream out,
                                                                      int written)

  Description copied from class: `IfsFileRotationHandler`
  Build a stream that counts bytes written.

  Parameters:
    `out` - the output stream
    `written` - the max size
  Returns:
    the metered stream

### checkFileRotation

    protected void checkFileRotation()

  Description copied from class: `IfsFileRotationHandler`
  Check if the file size limit is reached and rotate if so.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD