|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.log.impl.AbstractLoggingMechanism
org.openmdx.kernel.log.impl.AbstractFileLoggingMechanism
public abstract class AbstractFileLoggingMechanism
AbstractFileLoggingMechanism is an abstract class which defines the format and location of log files, so they all work consistently for the same application. The default file name where logs are created is:
[Path][App][LogClass][date].[extn]
where: [Path] = "c:\temp\"
[App] = "App"
[LogClass] = The Java Class name of the Log Class
(only used for unique logs)
[date] = today's date (only used for dated logs)
[extn] = "log"
The [App] default can be overridden by the application, it is taken
from the associated logger class. The [Path] and [extn] defaults can be
overridden by settings in a properties file, see the LogProperties
class for more information.
| Field Summary |
|---|
| Fields inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism |
|---|
OPEN_DATE_FORMAT |
| Constructor Summary | |
|---|---|
AbstractFileLoggingMechanism()
|
|
| Method Summary | |
|---|---|
protected void |
close()
Closes a file log |
List |
getActiveEntities()
Returns a list of all active (in use) log entities that are available by the file logging mechanisms controlled by this logger |
protected String |
getFileNameSuffixModifier(Log log)
Returns the file name suffix modifier. |
protected PrintWriter |
getPrintWriter()
Returns the PrintWriter the mechanism writes to. |
List |
getReadableEntities()
Returns a list of all readable log entities that are available by the file logging mechanisms controlled by this logger |
LogEntityReader |
getReader(LogEntity entity)
Returns an entity reader for given log entity |
List |
getRemoveableEntities()
Returns a list of all removeable log entities that are available by the file logging mechanisms controlled by this logger |
protected boolean |
hasDateRolledOver()
Checks the current date verses the date the log was opened. |
protected abstract boolean |
isDatedLog()
Mechanisms can be dated or non-dated. |
protected void |
logEvent(Log log,
LogEvent event)
Logs an event on the mechanism. |
protected void |
open(Log log)
Opens a file log. |
void |
removeEntity(LogEntity entity)
Remove a log entity |
protected void |
rollLogOver(Log log,
String reason)
Rolls a log over, typically on a date change, by closing the log and reopening it. |
String |
toString()
Return a nice debug string. |
| Methods inherited from class org.openmdx.kernel.log.impl.AbstractLoggingMechanism |
|---|
acceptsNotificationLogs, acceptsPerformanceLogs, acceptsStandardLogs, acceptsStatisticLogs, createFormatter, createNotificationEvent, getDateOpend, getFormatter, getLoggers, getName, 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 |
| Constructor Detail |
|---|
public AbstractFileLoggingMechanism()
| Method Detail |
|---|
protected void open(Log log)
open in class AbstractLoggingMechanismlog - A logger that opens the mechanismprotected void close()
close in class AbstractLoggingMechanismpublic String toString()
toString in class AbstractLoggingMechanismprotected abstract boolean isDatedLog()
protected void logEvent(Log log,
LogEvent event)
logEvent in class AbstractLoggingMechanismlog - the logger this mechanism belongs toevent - a log eventprotected PrintWriter getPrintWriter()
PrintWriter the mechanism writes to.
PrintWriterpublic List getActiveEntities()
getActiveEntities in interface ManageableMechanismgetActiveEntities in class AbstractLoggingMechanismLogEntity objectspublic List getReadableEntities()
getReadableEntities in interface ManageableMechanismgetReadableEntities in class AbstractLoggingMechanismpublic List getRemoveableEntities()
getRemoveableEntities in interface ManageableMechanismgetRemoveableEntities in class AbstractLoggingMechanismpublic void removeEntity(LogEntity entity)
removeEntity in interface ManageableMechanismremoveEntity in class AbstractLoggingMechanismString - an entity namepublic LogEntityReader getReader(LogEntity entity)
getReader in interface ManageableMechanismgetReader in class AbstractLoggingMechanismString - an entity name
protected void rollLogOver(Log log,
String reason)
NOTE: Do not call any method that itself calls logEvent() to prevent any loop. E.g. any notification calls do that!
log - The logger under which an event caused a rolloverreason - A rollover reasonprotected boolean hasDateRolledOver()
protected String getFileNameSuffixModifier(Log log)
log - a log
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||