org.jlf.log.fileMechanisms
Class UniqueFileLoggingMechanism

java.lang.Object
  |
  +--org.jlf.log.AbstractLoggingMechanism
        |
        +--org.jlf.log.fileMechanisms.AbstractFileLoggingMechanism
              |
              +--org.jlf.log.fileMechanisms.UniqueFileLoggingMechanism
Direct Known Subclasses:
UniqueDatedFileLoggingMechanism

public class UniqueFileLoggingMechanism
extends AbstractFileLoggingMechanism

This logging mechanism is the simplest implementation of a file logging mechanism. It is designed to have one log file per log, with the name of the log as part of the file name. It doesn't do anything fancy like rolling over to a new file when a date changes, it appends all messages to the same file name if already present.


Field Summary
 
Fields inherited from class org.jlf.log.fileMechanisms.AbstractFileLoggingMechanism
currentFileName, fileOutputStream, logPath
 
Fields inherited from class org.jlf.log.AbstractLoggingMechanism
compactDateFormat, dateFormat, dateOpened, logs, printStream, timeFormat
 
Constructor Summary
UniqueFileLoggingMechanism()
           
 
Method Summary
static AbstractLoggingMechanism getInstance()
           
protected  boolean isSharedLog()
          Mechanisms can be shared or unique.
 
Methods inherited from class org.jlf.log.fileMechanisms.AbstractFileLoggingMechanism
close, getFileName, logFileNamePrefix, logFileNameSuffix, open, toString
 
Methods inherited from class org.jlf.log.AbstractLoggingMechanism
closeForLog, compactCurrentDate, currentDate, currentTime, getLoggingMechanismForString, getName, hasDateRolledOver, isDatedLog, loggingPrefix, logString, notifyLogClosed, notifyLoggingLevelChange, notifyLogOpened, openForLog, rollLogOver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueFileLoggingMechanism

public UniqueFileLoggingMechanism()
Method Detail

getInstance

public static AbstractLoggingMechanism getInstance()

isSharedLog

protected boolean isSharedLog()
Description copied from class: AbstractLoggingMechanism
Mechanisms can be shared or unique. Shared mechanisms require the log name to be in every log entry (so you can distinguish between the log entries). Unique mechanisms name themselves uniquely (for example, have the log name in their file name) so they do not have to put the name of the log in their log entry. The default is shared (true).

Overrides:
isSharedLog in class AbstractLoggingMechanism