org.objectledge.logging
Class LedgeRollingFileAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.apache.log4j.WriterAppender
          extended by org.apache.log4j.FileAppender
              extended by org.apache.log4j.RollingFileAppender
                  extended by org.objectledge.logging.LedgeRollingFileAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class LedgeRollingFileAppender
extends org.apache.log4j.RollingFileAppender

A derivate of log4j.RollingFileAppender that accepts paths within Ledge file system.

Version:
$Id: LedgeRollingFileAppender.java,v 1.5 2004/12/22 08:34:55 rafal Exp $
Author:
Rafal Krzewski

Field Summary
private  FileSystem fileSystem
           
 
Fields inherited from class org.apache.log4j.RollingFileAppender
maxBackupIndex, maxFileSize
 
Fields inherited from class org.apache.log4j.FileAppender
bufferedIO, bufferSize, fileAppend, fileName
 
Fields inherited from class org.apache.log4j.WriterAppender
encoding, immediateFlush, qw
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
LedgeRollingFileAppender(FileSystem fileSystem)
          Creates new LedgeRollingFileAppender instance.
 
Method Summary
 void rollOver()
          Implements the usual roll over behaviour.
 void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize)
           Sets and opens the file where the log output will go.
 
Methods inherited from class org.apache.log4j.RollingFileAppender
getMaxBackupIndex, getMaximumFileSize, setMaxBackupIndex, setMaxFileSize, setMaximumFileSize, setQWForFiles, subAppend
 
Methods inherited from class org.apache.log4j.FileAppender
activateOptions, closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile
 
Methods inherited from class org.apache.log4j.WriterAppender
append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, writeFooter, writeHeader
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileSystem

private FileSystem fileSystem
Constructor Detail

LedgeRollingFileAppender

public LedgeRollingFileAppender(FileSystem fileSystem)
Creates new LedgeRollingFileAppender instance.

Parameters:
fileSystem - the Ledge FileSystem.
Method Detail

setFile

public void setFile(String fileName,
                    boolean append,
                    boolean bufferedIO,
                    int bufferSize)
             throws IOException

Sets and opens the file where the log output will go. The specified file must be writable.

If there was already an opened file, then the previous file is closed first.

Do not use this method directly. To configure a FileAppender or one of its subclasses, set its properties one by one and then call activateOptions.

Overrides:
setFile in class org.apache.log4j.RollingFileAppender
Parameters:
fileName - The path to the log file.
append - If true will append to fileName. Otherwise will truncate fileName.
bufferedIO - If true buffered IO will be used.
bufferSize - the size of buffer in bytes.
Throws:
IOException - if setting up the file IO fails.

rollOver

public void rollOver()
Implements the usual roll over behaviour.

If MaxBackupIndex is positive, then files {File.1, ..., File.MaxBackupIndex -1} are renamed to {File.2, ..., File.MaxBackupIndex}. Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.

If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.

Overrides:
rollOver in class org.apache.log4j.RollingFileAppender


Copyright © 2003-2006 objectledge.org. All Rights Reserved.