org.openmdx.kernel.log.impl
Class SharedFileStatisticsMechanism

java.lang.Object
  extended by org.openmdx.kernel.log.impl.AbstractLoggingMechanism
      extended by org.openmdx.kernel.log.impl.AbstractFileLoggingMechanism
          extended by org.openmdx.kernel.log.impl.SharedFileLoggingMechanism
              extended by org.openmdx.kernel.log.impl.SharedFileStatisticsMechanism
All Implemented Interfaces:
ManageableMechanism
Direct Known Subclasses:
SharedDatedFileStatisticsMechanism

public class SharedFileStatisticsMechanism
extends SharedFileLoggingMechanism

This logging mechanism adds today's date to the shared log file name, and also rolls logging over to a new file when dates change (the first new string logged on a new date causes the current log file to close and a new log file to be opened with today's date).


Field Summary
protected static SharedFileStatisticsMechanism singleton
           
 
Fields inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism
OPEN_DATE_FORMAT
 
Constructor Summary
protected SharedFileStatisticsMechanism()
           
 
Method Summary
 boolean acceptsNotificationLogs()
          This mechanism does not accept notification logs.
 boolean acceptsPerformanceLogs()
          This mechanism does not accept performance logs.
 boolean acceptsStandardLogs()
          This mechanism does not accept standard logs.
 boolean acceptsStatisticLogs()
          This mechanism accepts statistics logs.
protected  LogFormatter createFormatter(String logName, LogProperties logProperties)
          Create a new formatter.
protected  String getFileNameSuffixModifier(Log log)
          Returns the file name suffix modifier for statistics log files.
static AbstractLoggingMechanism getInstance()
          Returns the mechanism object.
 String getName()
          Returns the name of the mechanism.
protected  boolean isDatedLog()
          This file mechanism is not dated
 
Methods inherited from class org.openmdx.kernel.log.impl.AbstractFileLoggingMechanism
close, getActiveEntities, getPrintWriter, getReadableEntities, getReader, getRemoveableEntities, hasDateRolledOver, logEvent, open, removeEntity, rollLogOver, toString
 
Methods inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism
createNotificationEvent, getDateOpend, getFormatter, getLoggers, isOpen, isSharedLog, notifyLogClosed, notifyLoggingLevelChange, notifyLoggingPerformanceChange, notifyLoggingStatisticsChange, notifyLogOpened, setFormatter, setNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

singleton

protected static SharedFileStatisticsMechanism singleton
Constructor Detail

SharedFileStatisticsMechanism

protected SharedFileStatisticsMechanism()
Method Detail

getInstance

public static AbstractLoggingMechanism getInstance()
Returns the mechanism object. The mechanism is shared so it returns a singleton

Returns:
the mechanism singleton

isDatedLog

protected boolean isDatedLog()
This file mechanism is not dated

Overrides:
isDatedLog in class SharedFileLoggingMechanism
Returns:
false to indicate that the mechanism is not dated

acceptsStandardLogs

public boolean acceptsStandardLogs()
This mechanism does not accept standard logs.

Overrides:
acceptsStandardLogs in class AbstractLoggingMechanism
Returns:
true if log accepts standard records

acceptsStatisticLogs

public boolean acceptsStatisticLogs()
This mechanism accepts statistics logs.

Overrides:
acceptsStatisticLogs in class AbstractLoggingMechanism
Returns:
true if log accepts statistic records

acceptsPerformanceLogs

public boolean acceptsPerformanceLogs()
This mechanism does not accept performance logs.

Overrides:
acceptsPerformanceLogs in class AbstractLoggingMechanism
Returns:
true if log accepts performance records

acceptsNotificationLogs

public boolean acceptsNotificationLogs()
This mechanism does not accept notification logs.

Overrides:
acceptsNotificationLogs in class AbstractLoggingMechanism
Returns:
true if log accepts notification records

getFileNameSuffixModifier

protected String getFileNameSuffixModifier(Log log)
Returns the file name suffix modifier for statistics log files.

Overrides:
getFileNameSuffixModifier in class AbstractFileLoggingMechanism
Parameters:
log - a log
Returns:
A filename suffix modifier

createFormatter

protected LogFormatter createFormatter(String logName,
                                       LogProperties logProperties)
Create a new formatter.

Overrides:
createFormatter in class AbstractLoggingMechanism
Parameters:
logName - the logger's name
logProperties - the log properties

getName

public String getName()
Returns the name of the mechanism.

Overrides:
getName in class SharedFileLoggingMechanism
Returns:
The mechanism name


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.